Original link
This can is useful for testing, although the SQLite provider in In-memory mode is a more appropriate test rep Lacement for relational databases.
Supported Database Engines
- Built-in In-memory database (designed for testing purposesonly)
Supported platforms
Testing with InMemory
The InMemory provider is useful when you want to test components using something, approximates connecting to the R EAL database, without the overhead of actual database operations.
InMemory is not a relational database
EF Core database providers do not has a to is relational databases. InMemory is designed to being a general purpose database for testing, and are not designed to mimic a relational database.
Some examples of this include:
InMemory'll allow you to save data, would violate referential integrity constraints in a relational databas E.
If You use the Defaultvaluesql (string) for a property in your model, the This is a relational database API and would have no EF Fect when running against InMemory.
For many test purposes these differences would not matter. However, if you want to test against something that behaves more like a true relational database and then consider using SQLite in-memory mode.
EF Core in-memory Database Provider