public async Task <Store> GetOne(long id) { var store = await _storeData.GetOne(id); if (store == null) { throw new RecordNotFoundException(); } var result = new sz.api.Models.Store { Address = store.Address, Id = store.Id, Name = store.Name }; return(result); }
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); }