A
A
artshelom2020-07-17 23:59:49
ASP.NET
artshelom, 2020-07-17 23:59:49

How to do testing through a real database??

I want to do testing not through moq, but through the database. But I don’t understand how to make a connection to the database:
DbContextOptions
To do this, you need to pass an object, but I don’t understand how to do it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-07-18
@artshelom

DbContextOptions can be obtained using DbContextOptionsBuilder. Create a builder, configure it and get the result in the form of DbContextOptions
Here is an example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question