Esempio n. 1
0
        public async Task <Response <GameDto> > Get(Guid id)
        {
            var response = new Response <GameDto>();

            try
            {
                var result = await _gameDomainService.ReadAsync(id);

                return(response.SetResult(_mapper.Map <GameDto>(result)));
            }
            catch (EntityNotExistsException)
            {
                return(response.SetNotFound(Resources.CantFounGameWithGivenId));
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
                return(response.SetInternalServerError(Resources.UnexpectedErrorWhileGettingGame));
            }
        }