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