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 6736261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:06:33+00:00 2026-05-26T11:06:33+00:00

Since EF 3.5 doesn’t support collection parameters in the .Contain() method, I’ve seen numerous

  • 0

Since EF 3.5 doesn’t support collection parameters in the .Contain() method, I’ve seen numerous people suggest using custom expressions to work around this problem (http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/095745fe-dcf0-4142-b684-b7e4a1ab59f0).

However, if I have a long list of IDs to filter out the generated SQL in this case contains an endless list of ORs. For example,

WHERE (99999 = [Extent1].[ID]) OR (99998 = [Extent1].[ID]) OR (99997 = [Extent1].[ID]) OR...

This generated SQL takes forever to execute on my computer but once I change the ORs to a “true” IN clause:

WHERE [Extent1].[ID] IN (99999,99998,99997...)

it completes in less than a second.

My question is what could I do to make LINQ generate a “true” IN clause instead of ORs?

  • 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-26T11:06:33+00:00Added an answer on May 26, 2026 at 11:06 am

    The point of the workaround from MSDN is generation of OR sequence because LINQ provider in EFv1 doesn’t support IN operator and there is no way to generate it with LINQ.

    If you want to use LINQ and not ESQL your only option is to upgrade to EFv4.

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

Sidebar

Related Questions

On my current project I'm using SQL CE. Since it doesn't have support for
I'm attempting to create a custom strikethrough line for WP7 (since it doesn't support
Since VBScript doesn't support lookbehinds, I'm looking for an alternative solution. I have the
Since Exchange doesn't provide support for all local calendar types in OWA, I need
Since iphone doesn't support flash at all. Is it Darwin streaming server ?
For the iPhone, since sqlite3 doesn't support ALTER for a column, how do I
I'm writing a c++ RandomAccessIterator for a custom array type. Since it doesn't work
Since Flash doesn't support multithread how do you that in actionscript 3 ?
I'm using oracle 11 (not sure about the exact version, but since LISTAGG doesn't
Since Flash doesn't support thread, how does it manage to deal with multiple animations

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.