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