Exemplo n.º 1
0
        public async Task <IActionResult> GetClub([FromRoute] int id, [FromQuery] bool includeMembers = false)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var club = includeMembers ? await repo.GetClubWithMembers(id) : await repo.GetClub(id);

            if (club == null)
            {
                return(NotFound());
            }

            return(Ok(club));
        }