I have an application that I am trying to convert from web forms to MVC using EntityFramwork 5.0.
In my original application I call a stored procedure that returns a list of Lessons (Modules) that includes Name Of Module and Action. For the action column, if it returns a 1 (meaning IsComplete), I replace it with an anchor tag and text that says `Review Lesson`, otherwise I say "Take Lesson".
In my new application, I would like to implement this in my ModuleRecords repository. Below is my code and pseudo code for doing this. Any help in doing this would be greatly appreciated...
public IEnumerable<ModuleRecord> GetModuleRecordsByEnrollmentId(int enrollmentId)
return DbSet.Where(e => e.EnrollmentId == enrollmentId)
.Select(m => new ???
Action = If IsCompleted, say "Review Lesson" otherwise say "Take Lesson"