public Batches UpdateBatch(Batches batches) { var newBatch = context.Batches.Attach(batches); newBatch.State = Microsoft.EntityFrameworkCore.EntityState.Modified; context.SaveChanges(); return(batches); }
public Batches DeleteBatch(int id) { Batches batches = context.Batches.Find(id); context.Remove(batches); context.SaveChanges(); return(batches); }
//----------------------------Batches-------------------------- public Batches AddBatch(Batches batches) { context.Batches.Add(batches); context.SaveChanges(); return(batches); }