question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InvalidOperationException: Sequence contains more than one matching element NET6

See original GitHub issue

Hello, I am not sure if it is tied to NET6, but using .Any or Contains in queries started throwing this weird exception: image

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: image image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mdddevcommented, Dec 7, 2021

6.21.4 was just released. Thank you.

0reactions
alexkehcommented, Jan 10, 2022

ODP.NET 21.5 is now available.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found