public IEnumerable <Series> Get(string _Title) { var series = _seriesRepository.GetByTitle(_Title).Cast <Series>().ToList(); if (series == null || !series.Any()) { var response = new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent($"No Series found starting with title {_Title}"), ReasonPhrase = "Series matching title not found" }; throw new HttpResponseException(response); } return(series); }
public ActionResult Find(vmSearch vm) { var results = !string.IsNullOrWhiteSpace(vm.SearchTerm) ? _seriesRepository.GetByTitle(vm.SearchTerm) : _seriesRepository.GetAll(); return(PartialView("_gridResultsPanel", results)); }