예제 #1
0
 private IEnumerable <TrainingCourse> GetCourseViews(Expression <Func <Data.TrainingCourse, bool> > whereClause, DateTime when)
 {
     return(db.TrainingCourses
            .Where(whereClause)
            .OrderBy(f => f.DisplayName)
            .Select(TrainingCourse.GetTrainingCourseConversion(when)));
 }
예제 #2
0
 public TrainingCourse Get(Guid id)
 {
     // Get the data object (if it exists), and pass it through a conversion to the view model. If it doesn't exist, throw a 404 exception
     return(GetObjectOrNotFound(
                () => db.TrainingCourses
                .Where(f => f.Id == id)
                .Select(TrainingCourse.GetTrainingCourseConversion(DateTime.Now))
                .SingleOrDefault()));
 }