public void Update(T record) { using (var context = new BakeshoppeInventorySystem()) { context.Entry(record).State = EntityState.Modified; context.SaveChanges(); } }
public void Remove(T record) { using (var context = new BakeshoppeInventorySystem()) { context.Entry(record).State = EntityState.Deleted; context.SaveChanges(); } }
public void UpdateRange(List <T> records) { using (var context = new BakeshoppeInventorySystem()) { foreach (var record in records) { context.Entry(record).State = EntityState.Modified; } context.SaveChanges(); } }