LinqToSql Sub Entiity Multiple And Operators

Posted by halit on Stack Overflow See other posts from Stack Overflow or by halit
Published on 2012-03-30T16:42:03Z Indexed on 2012/03/30 17:30 UTC
Read the original article Hit count: 164

Filed under:
|
|

Hi I have an Array of Featureset Id , My Vehicles table has got sub table as FeatureSets I wrote Sql Query Like

    SELECT [t0].[ID] 
FROM [dbo].[SearchResultView] AS [t0]
 Join [dbo].[VehicleFeatureSet] AS [t1] on t0.ID = t1.VehicleID
where t1.FeatureSetID = 1 and t1.FeatureSetID= 2 and t1.FeatureSetID= 3 

I tried. But I Couldn't

var features = Request.QueryString["FeatureSets"].Split(',').ToList().ConvertAll(new Converter<string, int>(StrinToint)); 
IQueryable<SearchResultView> result = db.SearchResultViews.Where(m => m.Active == true);


            foreach (var featuree in features)
            {
                result = result.Where(m => m.VehicleFeatureSets.Any(c => c.FeatureSetID == featuree));
            }

How Can I write this LINQ Query

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET