示例#1
0
 public void Save <T>(List <T> item) where T : class
 {
     using (var db = new FitnesConntext())
     {
         db.Set <T>().AddRange(item);
         db.SaveChanges();
     }
 }
示例#2
0
 public List <T> Load <T>() where T : class
 {
     using (var db = new FitnesConntext())
     {
         var result = db.Set <T>().Where(t => true).ToList();
         return(result);
     }
 }