public async Task <CollectionResponse <Sport> > GetAll() { var sports = await _service.GetAllAsync(); return(new CollectionResponse <Sport> { Items = sports }); }
// GET: Sport public async Task <ActionResult> Index(string search, string sortBy, int page = 1) { ViewBag.sortNameParameter = string.IsNullOrEmpty(sortBy) ? SortingOperations.Descending : SortingOperations.Ascending; return(View(AutoMapper.Mapper.Map <IList <SportViewModel> >(await Service.GetAllAsync(search, page, sortBy)))); }