I am trying to test my IRepository interface via linqpad. To make one I have a constructor that looks like this:
IRepository dataAccess = new GenericRepository(dbContext);
This works fine in my own code, but I don't know how to get at the dbContext in linqpad. (I would rather not create my own if I don't have to.
All my code uses IRepository (so that I can unit test). I can't test it in LinqPad unless I can make a GenericRepository using the dbContext.
Any idea how I can get at the DbContext that LinqPad creates?
I just needed to set the connection to my EF Connection. After that I could use the this
keyword and it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With