Exemplo n.º 1
0
        public async Task <CollectionResponse <Sport> > GetAll()
        {
            var sports = await _service.GetAllAsync();

            return(new CollectionResponse <Sport>
            {
                Items = sports
            });
        }
Exemplo n.º 2
0
 // 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))));
 }