Exemple #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));
        }
Exemple #2
0
        private async Task <bool> CheckDoesAchievementExistAsync(Guid achievementId, CancellationToken cancellationToken)
        {
            var achievement = await _achievementService.GetAchievementByIdAsync(achievementId, cancellationToken);

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

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