Task 3: Complete SearchController

Add a Results() action method to SearchController:

  1. The Results() method should take in two parameters. Both parameters must be strings and the first one should be called “searchType” and the second one should be called “searchTerm”.
  2. First, you need to create a local variable called “jobs” that is of type List<Job>.
  3. If the user enters “all” in the search box, or if they leave the box empty, call the FindAll() method from JobData. Otherwise, send the search information to FindByColumnAndValue. In either case, store the results in a jobs List.
  4. Pass jobs into the Index.cshtml view.
  5. Pass ListController.ColumnChoices into the view, as the existing Index() action method does.

Run the tests in TestTaskThree to see how you did!