C#C
C#14mo ago
12 replies
SevenMgCreatine

LINQ: Duplicate key after GroupBy

Hello,

I have the following problem: I get an ArgumentException in the following code:

https://paste.mod.gg/jmzxdwctfzpw/0

The exception in the client system is: System.ArgumentException - An item with the same key has already been added. I don't understand how this could happen, because I
m already grouping the values by the userid and this is also the  key for the dictionary. So "GroupBy" creates multiple groups with the "same key"?

I don't have access to the client system, so I
m looking for potential causes for the exception. I am working with EF Core.

Thanks for helping.
A tool for sharing your source code with the world!
Was this page helpful?