Example #1
0
        public async Task <Product> GetProductById(int id)
        {
            var spec = new ProductsWithBrandSpecification(id);

            var product = await _unitOfWork.Repository <Product>().GetByIdWithSpec(spec);

            return(product);
        }
Example #2
0
        public async Task <IReadOnlyList <Product> > GetProductList(ProductSpecParams productParams)
        {
            var spec = new ProductsWithBrandSpecification(productParams);

            var products = await _unitOfWork.Repository <Product>().GetListWithSpec(spec);

            return(products);
        }