This is an option:
dbContext.Entry(entity).State = EntityState.Detached;
More Related Contents:
- Code-first vs Model/Database-first [closed]
- Should I enable or disable dynamic proxies with entity framework 4.1 and MVC3?
- Order navigation properties when using Include and/or Select methods with EF 4.1 Code-First?
- Entity framework code-first null foreign key
- How do you ensure Cascade Delete is enabled on a table relationship in EF Code first?
- Entity Framework Code First : Setting up One-To-One foreign key association using Annotations
- Ignoring a class property in Entity Framework 4.1 Code First
- The relationship could not be changed because one or more of the foreign-key properties is non-nullable
- Unique Key constraints for multiple columns in Entity Framework
- Entity Framework 6 Code first Default value
- EF Code First “Invalid column name ‘Discriminator'” but no inheritance
- Improve navigation property names when reverse engineering a database
- EF Code First: How to get random rows
- ADO.NET DbContext Generator vs. ADO.NET Poco Entity Generator (ObjectContext)
- How to include a child object’s child object in Entity Framework 5
- EF5 Code First Enums and Lookup Tables
- Entity Framework loading child collection with sort order
- Set decimal(16, 3) for a column in Code First Approach in EF4.3 [duplicate]
- Navigation Property without Declaring Foreign Key
- Ramifications of DbSet.Create versus new Entity()
- How to pass parameters to the DbContext.Database.ExecuteSqlCommand method?
- EF Code First DBContext and Transactions
- How to update not every fields of an object using Entity Framework and EntityState.Modified
- EF 4.1 loading filtered child collections not working for many-to-many
- EF Code First foreign key without navigation property
- Entity Framework Code First Using Guid as Identity with another Identity Column
- Using the Entry().CurrentValues.SetValues() is not updating collections
- Model First with DbContext, Fails to initialize new DataBase
- Entity Framework Code First Many to Many Setup For Existing Tables
- Getting exact error type in from DbValidationException