Skip to content

SingleOrDefault() with IncludeOptimized returns the first item for not single collection #822

@magicmanam

Description

@magicmanam

Hi guys!

Is it expected that SingleOrDefault() method returns the first element for IQueryable object returned by IncludeOptimized WHEN collection contains more than one element? I didnt find anything about it on your site and was a little bit confused.

https://dotnetfiddle.net/qk5l1f

My expectation here is to see InvalidOperationException thrown.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions