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. C#
  4. Difference between Expression<Func<>> and Func<>

Difference between Expression<Func<>> and Func<>

Scheduled Pinned Locked Moved C#
databasequestioncsharplinqtutorial
3 Posts 3 Posters 0 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.
  • A Offline
    A Offline
    anish27patel
    wrote on last edited by
    #1

    Hi All, Can you pls explain with example what is difference between Expression<Func<>> and Func<> in linq to sql query generation? Thanks in advance,

    Anish Patel

    S L 2 Replies Last reply
    0
    • A anish27patel

      Hi All, Can you pls explain with example what is difference between Expression<Func<>> and Func<> in linq to sql query generation? Thanks in advance,

      Anish Patel

      S Offline
      S Offline
      Sauro Viti
      wrote on last edited by
      #2

      Probably you can find here someone that could answer you, but I think that you have too much more chances if you move you post to the LINQ forum ;)

      1 Reply Last reply
      0
      • A anish27patel

        Hi All, Can you pls explain with example what is difference between Expression<Func<>> and Func<> in linq to sql query generation? Thanks in advance,

        Anish Patel

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I believe an expression is one line where as the Func can be multiples and uses brackets. Expression

        collection.Foreach(item => item.DoSomething());

        Function

        collection.Foreach(item =>
        {
        someReturn = DoSomething(item);
        item.DoSomethingElse(someReturn);
        });

        Query requirements usually force an expression.

        Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

        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