public async Task <Order> AddProductToOrderAsync(string productId, string accountId) { Product product = await productRepository.SelectByIdAsync(productId); Order order = await orderRepository.SelectProvisionalOrderByAccountIdAsync(accountId); order.AddProduct(product, 1); await orderRepository.UpdateAsync(order); return(order); }
public async Task <IActionResult> GetByIdAsync(string id) { var item = await productRepository.SelectByIdAsync(id); if (item == null) { return(NotFound()); } return(Ok(item)); }