linq concatenate query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • imbirek8

    linq concatenate query

    Hi,

    When I was using sql query in string I was doing
    string query = "select * from table sort by" + sortColumn;

    How to concatenate queries in linq ? (when I have column name as a string)

    Thanks for help


  • Alex Meleta

    #2
    Re: linq concatenate query

    Hi

    Not exactly the same way, but you can use requests like var query = db.Customers.Wh ere("City
    == @0 and Orders.Count >= @1", "London", 10), so, use text expression. See
    linq examples (http://msdn.microsoft.com/en-us/vcsharp/bb894665.aspx) and
    Linq Dynamic.

    Regards, Alex Meleta
    [TechBlog] http://devkids.blogspot.com
    Hi,
    >
    When I was using sql query in string I was doing string query =
    "select * from table sort by" + sortColumn;
    >
    How to concatenate queries in linq ? (when I have column name as a
    string)
    >
    Thanks for help
    >

    Comment

    Working...