» Home » ObjectContext » Page 1
ObjectContext never derives from an interface?? How do you apply DI/IoC in case of multiple types of ObjectContext?
by Pain999 in Coding

If you have a system that has multiple types of object contexts. For Eg: BillingObjectContext, HumanResourceObjectContext etc. All derive from ObjectContext but ObjectContext Class does not implement any specific interface like IObjectContext. How would you apply DI/IoC in case of multiple types of ObjectContext say using Ninject?


Reuseable ObjectContext or new ObjectContext for each set of operations?
by flakekun in Programming Languages

I'm new to the Entities Framework, and am just starting to play around with it in my free time. One of the major questions I have is regarding how to handle ObjectContexts.


Which is generally preferred/recommended of these:


This


public class DataAccess{
MyDbContext m_Context;
public DataAccess(){
m_Context = new MyDbContext()

Get DBContext from ObjectContext
by FriendL in Coding

I'm using the latest versions of ASP.NET MVC, SQL Server, and Entity Framework. I am not using code first.


I can easily create an object context using the class generated by my EDMX file.


But is there any way to obtain a DBContext object from that class? I would like to use its extended features.


Objectcontext in silverlight
by Kocur in Programming Languages

I'm developing a Silverlight Business App, using Entity Framework Code First and DBContext stuff. In my DbContext class I have implemented a property to access the underlyling ObjectContext as follows:


Public Class App1DBContext
Inherits DbContext
Public Sub New()
MyBase.New("name=cnxDB")
If System

ObjectContext from DataSet
by CyberGreg in Programming Languages

I'm trying to compile a linq query.


Func<ImportNewPermits_Enviance, String, EnumerableRowCollection<ImportNewPermits_Enviance._History_for_Permit__POI__Data_Row>> s_compiled =
CompiledQuery.Compile<ImportNewPermits_Enviance, String, EnumerableRowCollection<ImportNewPermits_Enviance._History_for_Permit__POI__Data_Row>>(
(c

Closing an EDM ObjectContext?
by Dittmar in Coding

I am getting started with the ADO.NET Entity Framework 4.0. I have created an EDM and data store for the app, and it successfully retrieves entities. The application holds the EDM's ObjectContext as a member-level variable, which it uses to call ObjectContext.SaveChanges(). So far, so good.


I am going to refactor to repositories later. Right now, my question is a bit more basic: Whe


ObjectContext vs DbContext
by Pierre LeBoo in Programming Languages

I've DbContext class from there I have an implementation of Generic Repositories and unit of work in a such way that leads to use ObjectContext. I followed this link in general.


I've read lot of posts related to the ObjectContext vs DBContext which somewhat makes sense. But I've no idea about my current implementation. just wondering if its an anti-pattern or I'm playing safe?


Is ObjectContext deprecated in .NET 4.5?
by FriendL in Coding

I've been using ObjectContexts for quite a long time now. Now that I've installed VS 2012, for my surprise the Entity Data Model does not have an option for a Code Generation Item that creates ObjectContexts and EntityObjects instead of DbContexts and POCOs.


Is it deprecated now? I see the ObjectContext cl


How can i check if an ObjectContext is still being used by the application?
by Raphaël Slinckx in Programming Languages

Well, the question pretty much says it all, but i'll try to give you the context. I'm using Entity Framework 4.0 where i frequently use the following syntax -


using (MLEntities context = ModelAccess.GetContext())
{
/*just a sample statement*/
this.ClientList = context.Clients.ToList();
...
//Some other code
}


ADO.net, Check if ObjectContext is writeable
by David Colebatch in Programming Languages

I have an embedded database in an asp.net mvc project. If I try to write to the file, I sometimes get a write failed exception because the SQL Server can't write to the file. How can I check an ObjectContext, if its writeable, without actually writing something to the database?


Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .