objectcontext

EF6 Type of context 'System.Data.Entity.Core.Objects.ObjectContext' is not supported

最后都变了- 提交于 2020-02-01 04:22:44
问题 I have a new project created using Visual Studio 2013 with an ADO.NET Entity Data Model (EF6). Now I have to use some Dynamic Data function (like access to MetaTable object), so I add this code: MetaModel model = new MetaModel(); model.RegisterContext(() => { return ((System.Data.Entity.Infrastructure.IObjectContextAdapter)new KiwiJuiceEntities()).ObjectContext; }, new ContextConfiguration() { ScaffoldAllTables = true }); but I've got this error: Type of context 'System.Data.Entity.Core

EF6 Type of context 'System.Data.Entity.Core.Objects.ObjectContext' is not supported

牧云@^-^@ 提交于 2020-02-01 04:22:13
问题 I have a new project created using Visual Studio 2013 with an ADO.NET Entity Data Model (EF6). Now I have to use some Dynamic Data function (like access to MetaTable object), so I add this code: MetaModel model = new MetaModel(); model.RegisterContext(() => { return ((System.Data.Entity.Infrastructure.IObjectContextAdapter)new KiwiJuiceEntities()).ObjectContext; }, new ContextConfiguration() { ScaffoldAllTables = true }); but I've got this error: Type of context 'System.Data.Entity.Core

Add EF 6.x EntityObject Generator in Visual Studio 2017

…衆ロ難τιáo~ 提交于 2020-01-23 12:25:08
问题 We are planning to switch to Visual Studio 2017. For our Entity Framework 6 edmx file we use the EntityObject Generator extension to create us the desired ObjectContext. This extension is only compatible up to VS2013 - inofficially up to VS2015. The solution to simply adjust the manifest file in the vsix does not seem to work for VS2017 though - I guess among others because the vsix architecture changed. Is there a way to get the ObjectContext template without using an old Visual Studio? I

Entity Framework ObjectContext with Dependency Injection

别说谁变了你拦得住时间么 提交于 2020-01-21 10:28:54
问题 Well, it seems like I'm stuck in my application structure. Here's what I want to do: UI layer: An ASP.NET webforms website. BLL: Business logic layer which calls the repositories on DAL. DAL: .EDMX file (Entity Model) and ObjectContext with Repository classes which abstract the CRUD operations for each entity. Entities: The POCO Entities. Persistence Ignorant. Generated by Microsoft's ADO.Net POCO Entity Generator. I'd like to create an obejctcontext per HttpContext in my repositories to

Entity Framework ObjectContext with Dependency Injection

Deadly 提交于 2020-01-21 10:28:45
问题 Well, it seems like I'm stuck in my application structure. Here's what I want to do: UI layer: An ASP.NET webforms website. BLL: Business logic layer which calls the repositories on DAL. DAL: .EDMX file (Entity Model) and ObjectContext with Repository classes which abstract the CRUD operations for each entity. Entities: The POCO Entities. Persistence Ignorant. Generated by Microsoft's ADO.Net POCO Entity Generator. I'd like to create an obejctcontext per HttpContext in my repositories to

Refresh ObjectContext or recreate it to reflect changes made to the database?

让人想犯罪 __ 提交于 2020-01-16 19:06:27
问题 I have a web service that exposes operations to and from a database. I'm using Entity Framework 4 for the DAL. I'm wondering what would be the best way to handle operations to and from the database. Would it be best not to keep alive an instance of the ObjectContext and instead create one for each operation done to the database? This seems to be a very bad way to handle this, but i can't think of another way to keep up with the changes made to the database. If i keep the same context alive,

Refresh ObjectContext or recreate it to reflect changes made to the database?

萝らか妹 提交于 2020-01-16 19:06:25
问题 I have a web service that exposes operations to and from a database. I'm using Entity Framework 4 for the DAL. I'm wondering what would be the best way to handle operations to and from the database. Would it be best not to keep alive an instance of the ObjectContext and instead create one for each operation done to the database? This seems to be a very bad way to handle this, but i can't think of another way to keep up with the changes made to the database. If i keep the same context alive,

Refresh ObjectContext or recreate it to reflect changes made to the database?

谁说我不能喝 提交于 2020-01-16 19:06:05
问题 I have a web service that exposes operations to and from a database. I'm using Entity Framework 4 for the DAL. I'm wondering what would be the best way to handle operations to and from the database. Would it be best not to keep alive an instance of the ObjectContext and instead create one for each operation done to the database? This seems to be a very bad way to handle this, but i can't think of another way to keep up with the changes made to the database. If i keep the same context alive,

EF 4: Problems understanding DetectChanges when using POCO (no self tracking ObjectContext)

荒凉一梦 提交于 2020-01-14 05:21:27
问题 I wonder if anyone can help me? I am having problems understanding why i need to issues DetectChanges on my POCO (non proxy) entities. Of course i have this line to ensure that proxies are not returned. context.ObjectStateManager.GetObjectStateEntry(order).State And doing some research it appears if i need to check the "state" of an object then i need to issue detechChanges But why would i need to check the State of an object? Basically I send along my POCO entity to a method that SAVES the

EF4 can’t add an object to the context even though I’m convinced it is not attached

那年仲夏 提交于 2020-01-06 19:51:19
问题 I can’t add an object to the ObjectContext even though I’m convinced it is not attached and it is not associated with a different context I am using EF 4 with POCO objects. If I try _currentContext.ObjectStateManager.GetObjectStateEntry(entityIn) Then I get the error The ObjectStateManager does not contain an ObjectStateEntry with a reference to an object of type 'System.Data.Entity.DynamicProxies.OrderItem_7D361CB49D75AA90681B4BA3F924139ECB0FC1426E38E90C7B884A4E9CD777DF'. Fair enough it’s