Task 2: Complete ListController
Complete the Jobs()
action method in ListController
. Right now, it returns a view, but we need to send some details about jobs to that view.
- The view relies on
ViewBag.jobs
, so to start create a list in the action method calledjobs
. - If the user selects “View All”, you should use
JobData.FindAll()
to populatejobs
with all the jobs and updateViewBag.title
. If the user selects something specific, you should useJobData.FindJobsByColumnAndValue()
to populatejobs
with jobs that only match that criteria and updateViewBag.title
to include the criteria the user chose. - Make sure to set
ViewBag.jobs
equal tojobs
and run the program to see how it is working now!
If everything looks good to you, run the tests in TestTaskTwo
in AutogradingTests
to make sure you are on the right track before proceeding to task three.