开发者

subsonic 3.0 dynamic search query

开发者 https://www.devze.com 2022-12-16 11:18 出处:网络
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

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

精彩评论

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

关注公众号