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