public async Task <IActionResult> SearchAsync(string customerId) { if (string.IsNullOrEmpty(customerId)) { return(BadRequest()); } try { var customer = await customersService.GetAsync(customerId); var sales = await salesServices.GetAsync(customerId); foreach (var sale in sales) { foreach (var item in sale.Items) { var product = await productsService.GetAsync(item.ProductId); item.Product = product; } } var result = new { Customer = customer, Sales = sales }; return(Ok(result)); } catch (Exception) { throw; } ///? throw new NotImplementedException(); }