I used EF in my .NET 6 Project. I want to do some condition then run query. For Ex:
var ProductModelList = Product.Include(b => b.Brand);
if (BrandId > 0)
{
ProductModelList.Where(b => b.BrandId == BrandId);
}
ProductModelList.Skip(skip).Take(PageSize).ToList();
Is this true way? Thank u to help