LINQ to SQL many to many int ID array criteria query -


OK it should really be simple, but I'm doing my head here and have read all the articles on it and try

ITEMS ItemID Description

ITEMFEATURES ItemID Feature ID

/ P>

Features Feature ID

Now I have a The search interface is where you can select any number (checkbox) I thoroughly search for them as a search [] which is called search movie.

I just want to find stuff that are included in the search feature.

Something like this:

  Return db.Items.Where (x => SearchFeatures.Contains (x.ItemFeatures.AllFeatures (.) FeatureID))  

Within my partial class, I've added a custom method attribute () which gives only all the features for that item, but I still can not find that specific LINQ query in any useful way. Can not integrate.

Grr, it should be easy, such a 1 second work in SQL so much thanks.

The following question will return the list of items based on the list of searchFeatures : < / P> from itemfeature in db.ItemFeatures where searchFeatures.Contains (itemFeature.FeatureID) select itemFeature.Item;

Here's the trick to start with the ItemFeatures table.


It is possible to find all the things that are all the attributes, as you asked in the comments here to move the move query dynamically. Check here:

  var itemFeatures = db.ItemFeatures; Foreach (var temp in searchFeatures) {// You will need this additional variable This is C # magic ;-) Var searchFeature = temp; // Wrap the archive with a filter item from the Feature = Feature feature in the item where the item feature. Select FetcherID == searchFeature Item; } Var item = Select the item item item in the item. ITEM;  

Comments