Example #1
0
        public Batches UpdateBatch(Batches batches)
        {
            var newBatch = context.Batches.Attach(batches);

            newBatch.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(batches);
        }
Example #2
0
        public Batches DeleteBatch(int id)
        {
            Batches batches = context.Batches.Find(id);

            context.Remove(batches);
            context.SaveChanges();
            return(batches);
        }
Example #3
0
 //----------------------------Batches--------------------------
 public Batches AddBatch(Batches batches)
 {
     context.Batches.Add(batches);
     context.SaveChanges();
     return(batches);
 }