Efcore: Query: ToList().EnumerableMethod() should get converted to queryable method

Created on 6 Dec 2019  路  2Comments  路  Source: dotnet/efcore

ToList().Contains did not work.
Repro code from #11884
C# var result = await db.Countries.Select(x => new CountryDTO { ID = x.ID, Title = x.Title, CountryStates = x.CountryStates.Select(y => y.State.Title).ToList() }).Where(x => x.CountryStates.Contains("Florida")).CountAsync();

area-query closed-fixed type-bug

Most helpful comment

This should be fixed already. What I am doing these days!

All 2 comments

This should be fixed already. What I am doing these days!

Already working
`C# [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Where_Queryable_ToList_Contains(bool async) { return AssertQuery( async, ss => ss.Set<Customer>() .Select(c => ss.Set<Order>().Where(o => o.CustomerID == c.CustomerID).Select(o => o.CustomerID).ToList()) .Where(e => e.Contains("ALFKI"))); }

Was this page helpful?
0 / 5 - 0 ratings