public async Task <GetRateDto> CreateAsync(CreateRateDto rate) { _logger.LogInformation("Add rate for game {GameId}", rate.GameId); bool isExists = await IsGameExistsAsync(rate.GameId); if (!isExists) { throw new BusinessLogicException(nameof(CreateRateDto.GameId), ValidationMessageConstants.GameIsNotExists); } return(await _rateApiClient.CreateRateAsync(_httpContextAccessor.GetAuthorizationHeaderOrDefault(), rate)); }
public virtual async Task <IActionResult> Create([FromBody] CreateRateDto rate) { var createdRate = await _rateService.CreateAsync(rate); return(CreatedAt(createdRate)); }