public T GetElement <T>(Func <T, bool> predicateFunc) where T : class { using (CarReservationContext context = new CarReservationContext()) { return(context.Set <T>().SingleOrDefault(predicateFunc)); } }
public List <T> GetAll <T>() where T : class { using (CarReservationContext context = new CarReservationContext()) { return(context.Set <T>().ToList()); } }