public IActionResult PostClub([FromBody] ClubBuilderData clubBuilderData) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var club = ClubBuilder.Get(clubBuilderData); _clubService.Insert(club); _clubService.SaveChanges(); return(Ok(ClubViewModel.Get(club))); }
public IActionResult GetClub([FromRoute] long id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var club = _clubService.GetWithRelations(id); if (club == null) { return(NotFound()); } return(Ok(ClubViewModel.Get(club))); }