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