Esempio n. 1
0
        public async Task <ThingDto> GetThing(int id)
        {
            _logger.LogInformation("{class}.{method} with id = [{id}] Invoked", nameof(ThingQueryService), nameof(GetThings), id);

            var userGuid = _httpContextUserService.GetUserGuid();
            var thing    = await _thingRepository.GetById(id, userGuid);

            if (thing is null || thing.Deleted)
            {
                throw new EntityNotFoundException <Thing>($"Id = [{id}], User Guid = [{userGuid}]");
            }

            return(_thingMappingService.MapToThingDto(thing));
        }