Exemple #1
0
        public async Task <WarehouseDto> GetAsync(Guid warehouseId)
        {
            if (warehouseId == default)
            {
                throw new ArgumentException("Warehouse id is invalid.", nameof(warehouseId));
            }

            var warehouse = await _warehouseRepository.GetAsync(warehouseId);

            if (warehouse == null)
            {
                throw new Exception($"Could not find warehouse with id = '{warehouseId}'.");
            }

            return(_mapper.Map <Warehouse, WarehouseDto>(warehouse));
        }