Giorgi / EntityFramework.Exceptions

Strongly typed exceptions for Entity Framework Core. Supports SQLServer, PostgreSQL, SQLite, Oracle and MySql.
https://giorgi.dev/entity-framework/introducing-entityframework-exceptions/
Other
1.44k stars 68 forks source link

Add InMemory Support to enable testing #34

Closed radderz closed 3 years ago

radderz commented 3 years ago

Would it be possible to get these same generalized exceptions using the "InMemory" efcore option?

Giorgi commented 3 years ago

@radderz Does the in-memory provider throw exception for validations that fail (such as length, unique, and so on). If the does it might be possible to get the same exceptions but I think it doesn't. It definitely doesn't validate requiredness but it will be added in EF Core 6: https://github.com/dotnet/efcore/issues/10613

radderz commented 3 years ago

I see that the in memory database isn't a relation database which is not what I expected, I can probably use an in memory sqlite instance to do the same and you already have an sqlite version.

Giorgi commented 3 years ago

Yes, in-memory SQLite is probably a better choice for testing.