» Home » ObjectContext » Page 1
ObjectContext never derives from an interface?? How do you apply DI/IoC in case of multiple types of ObjectContext?
Category : 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?


View Replies


Reuseable ObjectContext or new ObjectContext for each set of operations?
Category : 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()

View Replies


ObjectContext from DataSet
Category : 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

View Replies


Objectcontext in silverlight
Category : 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

View Replies


Closing an EDM ObjectContext?
Category : 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


View Replies


ObjectContext vs DbContext
Category : 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?


View Replies


Get DBContext from ObjectContext
Category : 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.


View Replies


Is ObjectContext deprecated in .NET 4.5?
Category : 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


View Replies


EF ObjectContext.SaveChanges is missing
Category : Coding

I am working with Entity Framework on a new Project. I've been using EF since a year ago. Today i've tried to generate Entity Data Model with Visual Studio (2008 SP1 and 2010) and it is generating object context properties and entitysets but has not generated SaveChanges method. I've even tried with databases that i've used previosuly to generate entity data models. I don't know what's happenin


View Replies


ASP.NET MVC, EF and Ninject : Different ObjectContext issue
Category : Programming Languages

I'm using Ninject for DI and injecting IDbContext to my repositories as constructor parameter. I get a "The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects." error while trying to do something like this:


This is my controller's action method:


public ActionResult BindSpace(int spaceId, int managerId)<

View Replies


Next
2012 / 2017 Copyrights BigHow , All Rights Reserved .