public async Task <IActionResult> AddMemberToDivisionAsync(ClanId clanId, DivisionId divisionId, MemberId memberId) { var userId = HttpContext.GetUserId(); var clan = await _clanService.FindClanAsync(clanId); if (clan == null) { return(this.NotFound("Clan does not exist.")); } var result = await _clanService.AddMemberToDivisionAsync( clan, userId, divisionId, memberId); if (result.IsValid) { return(this.Ok("Division created.")); } result.AddToModelState(ModelState); return(this.BadRequest(new ValidationProblemDetails(ModelState))); }