public static void DetachLocal <T>(this Cube3DIntersectionDbContext context, T t, int entryId) where T : class, IEntity { var local = context.Set <T>() .Local .FirstOrDefault(entry => entry.Id.Equals(entryId)); if (local != null) { context.Entry(local).State = EntityState.Detached; } context.Entry(t).State = EntityState.Modified; }
public Repository(Cube3DIntersectionDbContext dbContext) { _dbContext = dbContext; }