Exemple #1
0
        async Task <bool> IProductService.UpdateProductApiAsync(ProductEntity.ProductModel productModel)
        {
            try
            {
                var swaggerClient = new ProductOpenApiEntity.swaggerClient(httpClient.BaseAddress.AbsoluteUri, httpClient);

                var mapperOpenApiProductModel = mapper.Map <ProductOpenApiEntity.ProductModel>(productModel);

                var flag = await swaggerClient.UpdateAsync(mapperOpenApiProductModel);

                return(flag);
            }
            catch
            {
                throw;
            }
        }
Exemple #2
0
        async Task <IEnumerable <ProductEntity.ProductModel> > IProductService.GetProductsAsync()
        {
            try
            {
                var swaggerClient = new ProductOpenApiEntity.swaggerClient(httpClient.BaseAddress.AbsoluteUri, httpClient);

                var data = (await swaggerClient.GetproductsAsync()).ToList();

                var mapProductList = mapper.Map <List <ProductEntity.ProductModel> >(data);

                return(mapProductList);
            }
            catch
            {
                throw;
            }
        }