Entity Framework Core In-Memory DB Best Practices

preview_player
Показать описание
Coding Tutorial: In-memory databases are great for unit testing, but tread carefully if you want to avoid false positives - and worse, false negatives.

Рекомендации по теме
Комментарии
Автор

Is this still relevant for unit testing dbcontext in EF core now in 2024 with the repository pattern?

And thank you our videos, they are all really interesting and educational.

aandersn
Автор

Hi, indeed the in-memory db helps us with unit testing, by removing a lot of boilerplate code and managing relations between entities for us. But I think SQLite in-memory will also give you additional safety in terms of enforcing entities to comply with the database schema, required fields, foreign key restrictions etc..., which will allow us to catch those errors in unit tests. What do you think about using SQLite in-memory db for unit-tests?

olegsuprun
Автор

Is this better than the local charge or normal revenue charge? the speed of the immemory and is higher? and if you implement mars would it be better?

alexdevorigin