public IEnumerable <Serie> List(string category) { string _category = category; IEnumerable <Serie> series; if (string.Equals("All Series", _category, StringComparison.OrdinalIgnoreCase)) { series = serieRepository.Series().OrderBy(n => n.Id); //currentcategory = "All Series"; } else { if (string.Equals("Action", _category, StringComparison.OrdinalIgnoreCase)) { series = serieRepository.GetSerieByCategory(1); } else { series = serieRepository.GetSerieByCategory(2); } currentcategory = _category; } return(series); }