zzz projects Entity Framework 6 EF 6
Home EF Core Articles Knowledge Base Online Examples
  • Home
  • EF Core
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

5 results in tag: objectstatemanager

"An object with the same key already exists in the ObjectStateManager," says the error message.

I am trying to attach an entity to the ObjectContext. When I do so, the following InvalidOperationException is thrown:...An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the sa...
concurrency entity-framework objectstatemanager
asked by Shimmy

ObjectContext.Refresh()?

How to update ALL the dirty entities from the data store, and reset their changed values to the original store value?...The method ...ObjectContext.Refresh... requires as a parameter the entities to be refreshed.
dirty-data entity-framework objectstatemanager refresh reload
asked by Shimmy

In EF 4.1, how can I foreach through my dbcontext entities?

I'm using ASP.NET Entity Framework 4.1 MVC 3 (C#)...I want to foreach through all the entities in my DbContext. I need to be able to dynamically refer to my entities in order to make dynamic views....I have read Lerman's book, two MVC (2 & 3) books, msdn,...
asp.net-mvc-3 dbcontext entity-framework objectcontext objectstatemanager
asked by Benjamin

unexpected GetType() result for entity entry

While I iterating through ...ObjectStateEntries... I expected ...[t]... variable name will be ...MY_ENTITY...foreach (ObjectStateEntry entry in context.ObjectStateManager.GetObjectStateEntries(EntityState.Deleted)) { Type t = entry.Entity.GetType(); ...
c# dbcontext ef-code-first entity-framework objectstatemanager
asked by Anton Putov

MVC5/EF6: Object cannot be deleted because it was not found in the ObjectStateManager?

I have the following ...HttpPost... Delete() method which was working in my MVC5 app. To the best of my knowledge nothing relating to this controller, the View, or even the model has changed. ... // POST: Admin/UserManagement/Delete/5 [HttpPost, Ac...
asp.net-mvc asp.net-mvc-5 c# entity-framework-6 objectstatemanager
asked by Analytic Lunatic

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!