예제 #1
0
        public async Task <DocumentItemModel> GetItem(Guid id)
        {
            var item = await _documentsRepo.GetItemByid(id);

            return(new DocumentItemModel
            {
                Id = item.Id,
                WarehouseFrom = new WarehouseItemModel
                {
                    Id = item.WarehouseFromNavigation.Id,
                    Name = item.WarehouseFromNavigation.Name
                },
                WarehouseTo = new WarehouseItemModel
                {
                    Id = item.WarehouseToNavigation.Id,
                    Name = item.WarehouseToNavigation.Name
                },
                Product = new ProductItemModel
                {
                    Id = item.Stock.Id,
                    Name = item.Stock.Name
                },
                Value = (int)item.Value
            });
        }