예제 #1
0
 public List <T> Load <T>() where T : class
 {
     using (FitnessContext db = new FitnessContext())
     {
         return(db.Set <T>().Where(_ => true).ToList());
     }
 }
예제 #2
0
 public List <T> Load <T>(string fileName) where T : class
 {
     using (var db = new FitnessContext())
     {
         return(db.Set <T>().ToList());
     }
 }
예제 #3
0
 public void Save <T>(List <T> item) where T : class
 {
     using (FitnessContext db = new FitnessContext())
     {
         db.Set <T>().AddRange(item);
         db.SaveChanges();
     }
 }