public IActionResult EntryExit() { using (var context = new TurniketContext()) { ViewBag.Workers = JsonConvert.SerializeObject(context.Workers); } return(View()); }
public void Add <T>(T model) where T : class, new() { using (var context = new TurniketContext()) { context.Entry <T>(model).State = EntityState.Added; context.SaveChanges(); } }