/// <summary> /// The request to display search results. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> public IActionResult SearchResult(Actor actor) { /* Call the DAL and pass the values as a model back to the View */ ActorDAL actorDAL = new ActorDAL(@"Data Source=.\SQLEXPRESS;Initial Catalog=dvdstore;Integrated Security=True"); IList <Actor> actorList = actorDAL.FindActors(actor.LastName); return(View(actorList)); }
/// <summary> /// The request to display search results. /// </summary> /// <param name="request"></param> /// <returns></returns> public IActionResult SearchResult(ActorSearch request) { IActorDAL dal = new ActorDAL(@"Data Source=.\SQLEXPRESS;Initial Catalog=DVDStore;Integrated Security=True"); IList <Actor> actors = dal.FindActors(request.LastName); request.Results = actors; return(View("Index", request)); }