Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. How to convert String to LINQ query?

How to convert String to LINQ query?

Scheduled Pinned Locked Moved LINQ
linqtutorialcsharpdatabasequestion
2 Posts 2 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 7713115
    wrote on last edited by
    #1

    Hi, I need to convert a string to linq query. For example, the string could be like- string x = from p in where p.id = select p; (Note that the text enclosed in <> are actual values) Is it possible to convert this string into a IQueryable type? If yes, how?

    N 1 Reply Last reply
    0
    • U User 7713115

      Hi, I need to convert a string to linq query. For example, the string could be like- string x = from p in where p.id = select p; (Note that the text enclosed in <> are actual values) Is it possible to convert this string into a IQueryable type? If yes, how?

      N Offline
      N Offline
      Nitin S
      wrote on last edited by
      #2

      IQueryAble x = (from p in where p.id select new{ p.PropertyNameHere }).AsQueryAble();

      ============================================ The grass is always greener on the other side of the fence

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups