public static void TryUpdateManyToMany <T, TKey>( this ErrorSolutionDbContext db, IEnumerable <T> currentItems, IEnumerable <T> newItems, Func <T, TKey> getKey ) where T : class { db.Set <T>().RemoveRange(currentItems.Except(newItems, getKey)); db.Set <T>().AddRange(newItems.Except(currentItems, getKey)); }
public UnitOfWork( ErrorSolutionDbContext context ) { Context = context; }