-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable dbContext replace with MyTested.AspNetCore.EntityFrameworkCore #394
Comments
@grinay Why do you replace the DbContext by yourself? What do you want to accomplish? Do you just want to seed global data for every test case? Is that the scenario here? |
@ivaylokenov yes, basically in the startup class on the first run seeding some data into the database, eventually this data isn't available in dB for a test. Also in some scenarios, we are testing against the real SQL database, to test constraints, etc. And if I want to use data extension to check data in DB, i need to install mytested entity framework extension, which replaces DbContext to in-memory, and I am unable to find an option to disable this. |
I faced into next problem.
I'm replacing dbContext to InMemory by myself in TechStartup.cs in method ConfigureTestServices.
Then in my startup class, I have a method which seeding some data into db.
But later on, when I execute the controller method by Db replaced by MyTested.AspNetCore.EntityFrameworkCore to its in-memory DB context.
Can you advice how to avoid it?
The text was updated successfully, but these errors were encountered: