Exemple #1
0
 public List <DemoModel> Load()
 {
     using (DemoDBContext dbcontext = new DemoDBContext())
     {
         return(dbcontext.Demoes.ToList());
     }
 }
Exemple #2
0
 public int Save(DemoModel model)
 {
     using (DemoDBContext dbcontext = new DemoDBContext())
     {
         dbcontext.Demoes.Add(model);
         dbcontext.SaveChanges();
     }
     return(model.ID);
 }