Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 270433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:00:00+00:00 2026-05-12T00:00:00+00:00

Of these two options: var result = from c in coll where c %

  • 0

Of these two options:

var result = from c in coll where c % 2 == 0 select c;

var result = coll.Where ( c => c % 2 == 0 );

Which is preferable?

Is there any advantage to using one over the other? To me the second one looks better, but I would like to hear other people’s opinions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T00:00:00+00:00Added an answer on May 12, 2026 at 12:00 am

    If you’ve only got one or two clauses, I’d go for “dot notation”. When you start doing joins, groupings, or anything else that introduces transparent identifiers, query syntax starts to appeal a lot more.

    It’s often worth trying it both ways and seeing what’s the most readable for that particular situation.

    In terms of the generated code, they’ll be exactly the same in most cases. Occasionally there’ll be an overload you can use in dot notation which makes it simpler than the query expression syntax, but value readability over everything else in most cases.

    I also have a blog post on this topic. I would definitely recommend that developers should be comfortable with both options – I’d be quite concerned if a colleague were using LINQ but didn’t understand the fundamentals of what query expressions were about, for example. (They don’t need to know every translation involved, but some idea of what’s going on will make their lives a lot easier.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do these two keywords have exactly the same effect, or is there something I
I have these two pieces of code, wich one is more readable? foreach decimal
When building up a list of options in a select list using Javascript I'd
Hello I have two dependants select box, the second one is popularited after onchange
What is the real difference between these two options? What I know is: Register
So i have these two jquery functions which pass my XHR service a key
I'm having trouble with one of my sites on which two ajax requests are
I have these two options to implement a design, that are both extremely 'ugly'
These two methods exhibit repetition: public static Expression<Func<Foo, FooEditDto>> EditDtoSelector() { return f =>
These two may look like they have no correlation but bear with me! In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.