开发者

subsonic 3.0 dynamic search query

I want to build dynamic search query with s开发者_StackOverflow社区ubsonic 3.0. who can help me? Any sample Please.


Basically all you need to do is add conditions to an IQueryable based on your dynamic parameters. For example:

string productName = Request.Querystring[ProductName];

IQueryable<Product> productQuery = Product.All();

if(productName != null)
{
  productQuery = productQuery.Where(product => product.Name == productName);
}

IList<Product> filteredList = productQuery.ToList();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜