September 2016
Beginner to intermediate
186 pages
3h 28m
English
The media object component can be used to build hierarchical style lists such as blog comments or tweets. In the following example application, we'll use it to return a search result view when the user searches for employees. Our model will have a 'ReportsTo' field indicating which employee other employees report to; the media object component would be ideal to indicate this visually.
The method located in SearchController that searches for the employees and returns the results to the view is as follows:
public IActionResult SearchEmployees(string query) { ViewBag.SearchQuery = query; var employees = GetEmployees(); if (!string.IsNullOrEmpty(query)) { var results = employees.Where(p => p.Name.Contains(query)); return View(results); ...Read now
Unlock full access