public PagedResult <ProductListViewModel> GetVendorWiseList(int vendorId, ProductFilterRequest request) { var products = Db.Product .Where(p => p.Published && !p.IsDeleted && p.VendorId == vendorId) .ProjectTo <ProductListViewModel>(_mapper.ConfigurationProvider) .OrderBy(s => s.Rating).ThenBy(s => s.RatingBy) .GetPaged(request.Page, request.PageSize); return(products); }
public PagedResult <ProductListViewModel> GetCatalogWiseList(List <int> catalogIds, ProductFilterRequest request) { var products = Db.Product .Where(p => p.Published && !p.IsDeleted && catalogIds.Contains(p.CatalogId)) .ProjectTo <ProductListViewModel>(_mapper.ConfigurationProvider) .OrderBy(s => s.Rating).ThenBy(s => s.RatingBy) .GetPaged(request.Page, request.PageSize); return(products); }