Ejemplo n.º 1
0
 public static K FirstOrDefault <T, K>(this IRepository2 <T> repository,
                                       Expression <Func <T, bool> > predicate, Expression <Func <T, K> > selector)
     where T : class
 {
     return(repository.GetAll(predicate).Select(selector).FirstOrDefault());
 }
Ejemplo n.º 2
0
 public static IQueryable <T> GetAll <T>(this IRepository2 <T> repository,
                                         Expression <Func <T, bool> > predicate)
     where T : class
 {
     return(repository.GetAll().Where(predicate));
 }
Ejemplo n.º 3
0
 public static T FirstOrDefault <T>(this IRepository2 <T> repository,
                                    Expression <Func <T, bool> > predicate)
     where T : class
 {
     return(repository.GetAll().FirstOrDefault(predicate));
 }
Ejemplo n.º 4
0
 public static IQueryable <CoursePrerequisite> GetCoursePreCourses(IRepository2 <CoursePrerequisite> coursePrerequisiteService, string courseTC)
 {
     return(coursePrerequisiteService.GetAll(x => x.Course_TC == courseTC && x.RequiredCourse_TC != null));
 }