public ViewResult AddSportAttribute(SportAttributesViewModel viewModel) { ViewBag.Title = "Sportmateriaal toevoegen"; viewModel.Sports = _sportAccess.GetSports(); return(View(viewModel)); }
public ViewResult AddEvent() { ViewBag.Title = "Evenementen toevoegen"; return(View(new EventSportViewModel { Sports = _sportAccess.GetSports() })); }
public ViewResult Sport(int page = 1) => View(new SportViewModel { Sports = _sportAccess.GetSports() .OrderBy(s => s.Type) .Skip((page - 1) * PageSize) .Take(PageSize), PagingViewModel = new PagingViewModel { CurrentPage = page, ItemsPerPage = PageSize, TotalItems = _sportAccess.GetSports().Count() } });
public IActionResult Get() { var sports = _sportAccess.GetSports(); var response = new List <HALResponse>(); foreach (var sport in sports) { var resource = new SportResource(sport); response.Add(new HALResponse(resource).AddLinks( new Link("self", "/api/Sport/" + sport.SportId + "", null, "GET"))); } return(Ok(response)); }