コード例 #1
0
 public T GetElement <T>(Func <T, bool> predicateFunc) where T : class
 {
     using (CarReservationContext context = new CarReservationContext())
     {
         return(context.Set <T>().SingleOrDefault(predicateFunc));
     }
 }
コード例 #2
0
 public List <T> GetAll <T>() where T : class
 {
     using (CarReservationContext context = new CarReservationContext())
     {
         return(context.Set <T>().ToList());
     }
 }