public async Task <ActionResult <GetAchievementResponseModel> > Get(
            [FromRoute] Guid id
            )
        {
            var queryRequest = new GetAchievementQueryRequestModel {
                Id = id
            };
            var queryResponse = await this.getAchievementQuery.ExecuteAsync(queryRequest);

            return(GetAchievementResponseModel.FromBusinessModel(queryResponse));
        }
Exemple #2
0
        public async Task <Achievement> ExecuteAsync(GetAchievementQueryRequestModel queryRequest)
        {
            var achievement = await this.achievementsRepository.GetAsync(queryRequest.Id);

            if (achievement == null)
            {
                throw new HttpException(HttpStatusCode.NotFound, $"Achievement (ID: {queryRequest.Id}) cannot be found.");
            }

            return(Achievement.FromTableRecord(achievement));
        }