This means that the IQueryable<> will be treated as an IEnumerable<> and the filter will be applied locally. This is usually not what is expected and so the warning would help nudge the developer. If the developer really did want this, they can use .AsEnumerable().
Add an analyzer to warn against using one of the following "Enumerable" extension methods on an
IQueryable<>
.If you pass in a delegate filter, it will pick the overload from
Enumerable
instead of the one fromQueryable
.This means that the
IQueryable<>
will be treated as anIEnumerable<>
and the filter will be applied locally. This is usually not what is expected and so the warning would help nudge the developer. If the developer really did want this, they can use.AsEnumerable()
.