How can we debug with InMemoryDatabase and how can we know exactly the key is duplicate?

Kha Vo 20 Reputation points
2024-04-10T08:27:15.02+00:00

How can we debug with InMemoryDatabase Unit test?

Also I have question that when I get this error for example "An item with the same key has already been added. Key: 16c568e8-b00d-46b2-ab27-cdb7685839ae" why VS don't point exactly what entity is duplicate key? I can't also in Callstack

Or another example that when we get error "Null Reference Objection. Object reference not set to an instance of an object" I don't see what exactly object is null.

Should we have the new update for VS of this point? It will help developer saving time and more convenience while working.

Thanks.

User's image

Developer technologies | .NET | Entity Framework Core
Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.