InvalidOperationException: Sequence contains more than one matching element NET6
See original GitHub issueHello, I am not sure if it is tied to NET6, but using .Any or Contains in queries started throwing this weird exception:
Reproduction code steps (any enumerable will do, no matter how it is created):
var a = new decimal[]{ 10 }.AsEnumerable();
var test =await this.Context.Set<TJobLine>().Where(x => a.Contains(x.Status.Value) && x.Valid == 1).ToListAsync();
Project version NET6
library versions 5.0.12 for EF Core and 5.21.4 oracle EF core and 3.21.4 for managed data acces core:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
c# - Entity Framework | Sequence contains more than one ...
You have net6.0 target framework which is still not released while you have installed EF6 which is a previous iteration Entity Framework ...
Read more >NET6 exception on Linq queries with EntityFramework 5
Query.QueryableMethods' threw an exception. ---> System.InvalidOperationException: Sequence contains more than one matching element at System.
Read more >.Net 6 Upgrade - Microsoft Q&A
' InvalidOperationException: Sequence contains more than one matching element. We have used a few libraries projects and its created with .Net ...
Read more >"Sequence contains more than one matching element" error ...
InvalidOperationException : Sequence contains more than one matching element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 ...
Read more >Sequence contains more than one matching element
I have a form with Make and Model There are a few thousand rows in the model table as the database that we...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
6.21.4 was just released. Thank you.
ODP.NET 21.5 is now available.