Frequently Used Methods
Frequently Used Methods
Frequently Used Methods
Frequently Used Methods
public async Task <List <ProductVM> > GetByCategoryIdAsync(int categoryId) { if (!await _productCategoryRepository.ExistAsync(categoryId)) { return(null); } // Assumption: only return active products List <Product> dbProducts = await _productRepository.FindAsync(x => x.IsActive.Value && x.CategoryId == categoryId); return(_mapper.Map <List <Product>, List <ProductVM> >(dbProducts)); }