How can I access existing context in ASP.NET Core application?

asp.net-core-webapi c# entity-framework-core

Accepted Answer

Many thanks to Osama Enas for posting the solution in the comments.
To ensure that the context is instantiated when I get the request, I just had to add the necessary context to the controller's constructor parameters list.

0
3/26/2020 12:42:43 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow