public async Task <List <DTO.Vendors.Product> > GetProductsFromBazzasBazaar(int?CategoryId, String CategoryName, double?MinPrice, double?MaxPrice) { BazzasBazaarService.StoreClient svc = new BazzasBazaarService.StoreClient(); List <BazzasBazaarService.Product> svcProducts = await svc.GetFilteredProductsAsync(CategoryId, CategoryName, MinPrice, MaxPrice); List <DTO.Vendors.Product> products = new List <DTO.Vendors.Product>(); foreach (BazzasBazaarService.Product prod in svcProducts) { products.Add(Mappers.MapFromBazzas(prod)); } return(products); }
public async Task <HttpResponseMessage> OrderFromBazzasBazaar(DTO.Order Order) { BazzasBazaarService.StoreClient svc = new BazzasBazaarService.StoreClient(); BazzasBazaarService.Order order = await svc.CreateOrderAsync(Order.AccountName, Order.CardNumber, Order.ProductID, Order.Quantity); #pragma warning disable CS0618 // Type or member is obsolete var returnOrder = await JsonConvert.SerializeObjectAsync(order); #pragma warning restore CS0618 // Type or member is obsolete return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(returnOrder, System.Text.Encoding.UTF8, "application/json") }); }