public int DeleteWorker(int id)
 {
     try
     {
         Worker worker = dbContext.Workers.Find(id);
         dbContext.Workers.Remove(worker);
         dbContext.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 2
0
 public void Add(Worker workerToAdd)
 {
     dbcontext.Set <Worker>().Add(workerToAdd);
     dbcontext.SaveChanges();
 }