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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:51:22+00:00 2026-05-17T02:51:22+00:00

Could somebody help me to answer how to rewrite raw SQL filter WHERE (…)

  • 0

Could somebody help me to answer how to rewrite raw SQL filter WHERE (…) OR (…) with ObjectQuery bilder, please?

String queryRaw = "SELECT ls.LocaleName, ls.IsActive, ls.LocaleDescription " +
                  "FROM RoutesEntities.Locales AS ls ";

                  //" WHERE ls.LocaleName = 'en' OR ls.LocaleName = 'de' "

this._queryData = new ObjectQuery<DbDataRecord>(queryRaw, routesModel);

I would use Where() method, but it generates where clauses separated by AND, though i want to use OR instead. Is it possible with QueryBilder?
I mean how to use this to generate “OR separated” filter :

Where("it.LocaleName IN (@localeName)", new ObjectParameter("localeName", String.Join(",", localeName)))

Thanks, Artem

  • 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-17T02:51:23+00:00Added an answer on May 17, 2026 at 2:51 am

    It is happening again, i answer my question myself. Thanks for this.

    Here is the answer :

    ObjectQuery as EntityCommand DO NOT SUPPORT “IN” CLAUSE YET … it means that there is no opportunity to use WHERE IN filter for query sending to DB until you use already selected DataSet from DB. So only LINQ methods can do this and only with selected List<>

    Though, there is an alternative not so clear but effective decision – you can use multiple OR conditions in your query and they work fine for me :

    ObjectQuery<DbDataRecord> query = query.Where("it.RouteID=1 OR it.RouteID=2");
    

    Hope this will help someone … enjoy 🙂

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

Sidebar

Related Questions

Could somebody help me.I would like to get substring of string by ant.For example
Could somebody please help me get Clang up and running? (I don't have 3.2)
Could somebody help me with routing rules configuration, please? I got problem with route
Could somebody please help me setup Emacs Tramp to do a double hop? I
Could somebody please help me understand the concept of 'impersonation'? The way I understand
Could somebody help me please with configuring the vhosts in XAMPP, Linuxmint. Xampp starts
Good day, please could somebody help me find out what's wrong with my code.
Hope somebody could help me out, I am trying to find a solution for
I was wondering if somebody could help me with how exactly to write some
UPDATE AT THE BOTTOM Maybe somebody could help with this... been struggling with it

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.