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