예제 #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());
     }
 }