public IActionResult GetAllClubs() { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var clubs = _clubRepository.GetAllClubs(); return(Ok(clubs)); }
public async Task <PagedClubsDTO> GetAllClubs( int pageNumber, int pageSize, string userId, ClubFilterData filterData) { IEnumerable <Club> clubs; clubs = await _clubRepository.GetAllClubs(userId); var result = GetClubs(pageNumber, pageSize, clubs, filterData); return(result); }
public async Task <ActionResult <ClubResponse> > GetAllClubs() { try { var clubs = await _repository.GetAllClubs(); var clubsResponse = new List <ClubResponse>(); foreach (var c in clubs) { var clubResponse = _mapper.Map <ClubResponse>(c); clubsResponse.Add(clubResponse); } _logger.LogInformation($"Clubs have been downloaded."); return(Ok(clubsResponse)); } catch (System.Exception ext) { _logger.LogError(ext, "Failed to download clubs list."); // TODO return error object with proper error code. return(BadRequest()); } }
public IActionResult GetAllClubs() => Ok(_clubRepository.GetAllClubs());
public List <Organization> RetrieveAllClubs() { return(_clubRepository.GetAllClubs()); }