none
how do you do a multiple option search query? RRS feed

  • Question

  • I have a search that has 4 different options to search for, where the user can chose one, all or as many as the user wants to chose from the 4 different search options. That is 15 different 'Where' clause possibilities. Does that mean I have to write 15 different queries?

    Thank you

    Sunday, March 11, 2012 7:56 PM

Answers

  • Hi mutlyp,

    Welcome to MSDN Forum.

    You can use Dynamic Linq to build your query statement dynamically. It allows you to build Linq statement as traditional dynamic sql query. You can use string concatenating to build the Linq statement.

    I hope the information can help.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, March 13, 2012 3:01 AM
    Moderator