tags:

views:

63

answers:

1

Hi , I want to build dynamic search query with subsonic 3.0. who can help me? Any sample Please.

A: 

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();
Adam
Thanks a lot, i will try as you mention
maung