示例#1
0
 public IEnumerable <T> GetLists()
 {
     using (var db = new SALContext())
     {
         return(db.Set <T>().ToList());
     }
 }
示例#2
0
 public T GetById(int id)
 {
     using (var db = new SALContext())
     {
         return(db.Set <T>().FirstOrDefault(x => x.Id == id));
     }
 }
示例#3
0
 public IEnumerable <T> GetLists()
 {
     using (var db = new SALContext())
     {
         var typeList = db.Set <T>().ToList();
         return(typeList);
     }
 }
示例#4
0
 public IEnumerable <T> GetByIdPatient(int id)
 {
     using (var db = new SALContext())
     {
         var datesList = db.Set <T>().Where(x => x.IdPatient == id).ToList();
         return(datesList);
     }
 }