none
String.Concat ===> LinqQuery ? Other ideas RRS feed

  • Question

  • I'm trying to build out a Linq query, the amount of arguments and values will vary. I was thinking of making a string out of the properties for each instance and just combining them all into one query.

    What do you think ?

    • Moved by Martin_Xie Wednesday, October 12, 2011 5:09 AM Move to LINQ Forum for better support (From:Visual C# General)
    Tuesday, October 11, 2011 9:52 PM

Answers

All replies

  • Use stringbuilder to do the concatenation.

    The other idea is - use PARAMS typed parameter to a method which is going to execute the linq query if the implementation is possible.

    Tuesday, October 11, 2011 11:29 PM
  • Can you give an example or two of what exactly you want to achieve?


    Warm Regards, Deepak Pandit
    Wednesday, October 12, 2011 3:40 AM
  • Can you give an example or two of what exactly you want to achieve?


    Warm Regards, Deepak Pandit

    I'm trying to take the values from my querybuilder objects and parse them into a LINQ query, Here is a screenshot of what I have so far. I have figured out the individual queries just not together.

    Wednesday, October 12, 2011 5:33 PM
  • I ended up using code dom
    • Marked as answer by rreeves84 Monday, October 17, 2011 6:58 PM
    Monday, October 17, 2011 6:58 PM