Пример #1
0
        public async Task <Article> Insert(ArticleEntry value)
        {
            var result = await _articleData.Insert(new commons.models.Article
            {
                Id           = value.Id,
                Description  = value.Description,
                Name         = value.Name,
                Price        = value.Price,
                StoreId      = value.StoreId,
                TotalInShelf = value.TotalInShelf,
                TotalInVault = value.TotalInVault
            });

            var response = new sz.api.Models.Article
            {
                Id           = result.Id,
                Description  = result.Description,
                Name         = result.Name,
                Price        = result.Price,
                StoreId      = result.StoreId,
                StoreName    = result.Store?.Name,
                TotalInShelf = result.TotalInShelf,
                TotalInVault = result.TotalInVault
            };

            return(response);
        }
Пример #2
0
        public async Task <Article> GetOne(long id)
        {
            var article = await _articleData.GetOne(id);

            var store = await _storeData.GetOne(article.StoreId);

            var result = new sz.api.Models.Article
            {
                Id           = article.Id,
                Description  = article.Description,
                Name         = article.Name,
                Price        = article.Price,
                StoreId      = article.StoreId,
                TotalInShelf = article.TotalInShelf,
                TotalInVault = article.TotalInVault,
                StoreName    = store?.Name
            };

            return(result);
        }