Contains on a list

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
damon.cognito
Posts: 50
Joined: Wed 22 Jul 2009 09:30

Contains on a list

Post by damon.cognito » Thu 04 Mar 2010 14:07

Is there anyway to do a contains on list (effectively 'where xxx in (1,2,4,6)') with a LINQ query in the following form?

e.g.

Code: Select all

var query = from table1 in entity.Table1
            from table2 in documentHead.Table2
            where table1.InternalType.Contains(TypeRestriction)
            orderby table2.StampRevision descending
            select new
            {
                table1.OIDTable1,
                table2.OIDTable2,
                table2.Description,
                table1.Extension,
                max = table1.Table2.Max(x => x.OIDTable2)
            };
where TypeRestriction is a list of integers and there is a one to many relationship between table1 and table2.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 09 Mar 2010 10:50

This topic was already discussed here:
http://www.devart.com/forums/viewtopic.php?p=41997

Post Reply