Ejemplo n.º 1
0
        public async Task <bool> RemoveTrendingProduct(RemoveTrendingProductDto trendingProduct)
        {
            _context.Remove(trendingProduct.Adapt <TrendingProduct>());
            await _context.SaveChangesAsync();

            return(await Task.FromResult(true));
        }
Ejemplo n.º 2
0
        public async Task <Response <TrendingProduct> > RemoveTrendingProduct(RemoveTrendingProductDto trendingProduct)
        {
            var httpResponse = new Response <TrendingProduct>();

            try
            {
                httpResponse.RequestState = true;
                httpResponse.ErrorState   = !await _productManager.RemoveTrendingProduct(trendingProduct);
            }
            catch (Exception ex)
            {
                httpResponse.ErrorState = true;
                httpResponse.ErrorList.Add(ex.Adapt <ApiException>());
            }
            return(httpResponse);
        }