New Posts New Posts RSS Feed: Where IN query
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Where IN query

 Post Reply Post Reply
Author
mbevins1 View Drop Down
Newbie
Newbie


Joined: 16-Jan-2009
Posts: 27
Post Options Post Options   Quote mbevins1 Quote  Post ReplyReply Direct Link To This Post Topic: Where IN query
    Posted: 15-Jun-2009 at 12:06pm
Hello, I am trying to figure out IN clauses.  For example, I have an entity called Vehicles, with in the Vehicles, I have an operation ID.  I want to return all vehicles where operationID in (1,2,3).
 
Also, the 1,2 3 operations are actually in a collection (

ObservableCollection<Operation>)

 
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jun-2009 at 5:32pm
See http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/659ff6b9-3d4d-487e-9f1c-d3853ba49415

Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jun-2009 at 5:35pm
...and FYI, this is, I believe, what it would look like if supported in LINQ to Entities (which it isn't):

      string[] names = { "QUICK-Stop", "Chop-suey Chinese", "Simons bistro" };
      var query = _entityManager.Customers.Where(c => names.Contains(c.CompanyName));

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down