Mid EF Core

How to detach an entity from the context?

  • Use context.Entry(entity).State = EntityState.Detached.
  • Useful to avoid tracking or to simulate detached state.

More from Entity Framework Core Tutorial

All questions for this course