Skip to content

Consider removing support for collections of primitives typed as object array/list used in parameters to queries #35332

@maumar

Description

@maumar

Currently it's possible to do something like this:

        var orderIds = new object[] { 10248, 10249 };
        return AssertQuery(
            async,
            ss => ss.Set<Order>()
                .Where(o => orderIds.Contains(o.OrderID)));

This generates type mapping with a comparer being ListOfReferenceTypesComparer typed as object, but it's element comparer is DefaultValueComparer<int>. This makes it harder to reason about types of things involved (type argument of the element comparer is not compatible with type argument of the collection comparer), but doesn't really buy us much - if the collection contains non-int it will blow up anyway.

        var orderIds = new object[] { 10248, 10249, "Foo" };

We should consider removing this to make our code cleaner.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions