示例#1
0
        public async Task <IActionResult> GetAchievementByIdAsync(Guid achievementId, CancellationToken cancellationToken)
        {
            var item = await _achievementService.GetAchievementByIdAsync(achievementId, cancellationToken);

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

            return(Ok(item));
        }
示例#2
0
        private async Task <bool> CheckDoesAchievementExistAsync(Guid achievementId, CancellationToken cancellationToken)
        {
            var achievement = await _achievementService.GetAchievementByIdAsync(achievementId, cancellationToken);

            return(achievement != null);
        }
示例#3
0
        public async Task <IActionResult> GetAchievementById(int id)
        {
            var result = await _achievementService.GetAchievementByIdAsync(id);

            return(StatusCode(result.HttpStatusCode, result.Data));
        }