11 lines
228 B
C#
11 lines
228 B
C#
|
public IQueryable<Product>
|
||
|
GetProducts(string keyword)
|
||
|
{
|
||
|
IQueryable<Product> query = _db.Products;
|
||
|
|
||
|
if (!String.IsNullOrWhiteSpace(keyword))
|
||
|
{
|
||
|
query = query.Where(p => p.ProductName.Contains(keyword));
|
||
|
}
|
||
|
return query;
|
||
|
}
|