I am making a web api for a google classroom-type system with classes and accounts and I have database contexts for classes and accounts separately. What I want to do is access the data from the account context in my class controller. Is there any way I could do this?
Asked
Active
Viewed 29 times
1 Answers
0
just do a couple inherited classes and run them thru the dependency injection setup. The MS docs have a pretty good example of how to do this: dbcontext example
Then insert the inherited classes in your function parameters where ever you need it for whichever (or both) dbcontext you need for that function.
But, big caveat, if you are passing in both you are probably not KISS and keeping your code clean, single use, and small.

Bulsatar
- 45
- 7