public virtual void Delete(params T[] items) { using (var context = new CognizantContext()) { foreach (T item in items) { context.Entry(item).State = EntityState.Deleted; } context.SaveChanges(); } }
public virtual void AddNoValidate(params T[] items) { using (var context = new CognizantContext()) { foreach (T item in items) { context.Entry(item).State = EntityState.Added; } context.Configuration.ValidateOnSaveEnabled = false; context.SaveChanges(); } }