C# 14 changes the rules for method selection so that ReadOnlySpan extensions are preferred over corresponding Linq methods.
This can cause existing code that works to fail when compiling with C#14 and .NET10+ (.NET8 seems to not be effected).
Not working:
int[] prodIds = [ 1, 2, 3, 4, 5 ];
EntityQuery<Product> query = catalog.GetProductsQuery().Where(p => prodIds.Contains(p.ProductID));
Working:
IEnumerable<int> prodIds = [ 1, 2, 3, 4, 5 ];
EntityQuery<Product> query = catalog.GetProductsQuery().Where(p => prodIds.Contains(p.ProductID));
C# 14 changes the rules for method selection so that ReadOnlySpan extensions are preferred over corresponding Linq methods.
This can cause existing code that works to fail when compiling with C#14 and .NET10+ (.NET8 seems to not be effected).
Not working:
Working: