Chcę wygenerować dane do testów, których będę używać podczas pisania frontu. Jak to najlepiej zrobić? W EF Core jest HasData
, ale w dokumentacji piszą, że do danych testowych lepiej tego nie używać, bo ma za duże ograniczenia. Piszą też, że:
The seeding code should not be part of the normal app execution as this can cause concurrency issues when multiple instances are running and would also require the app having permission to modify the database schema.
Depending on the constraints of your deployment the initialization code can be executed in different ways:
Running the initialization app locally
Deploying the initialization app with the main app, invoking the initialization routine and disabling or removing the initialization app.
- Tak to się robi? Tworzy się osobną aplikację konsolową, która służy do inicjalizacji bazy?
- Czy dane do testów integracyjnych i dane, które idą na front podczas developmentu, powinny być różne?