How to use DI inside a static Method in Asp.net Core rc1

Viewed 11746

I see defaut template use ServiceProvder.GetService<ApplicationDbCotnext>() to initialize a DbContext, But when you inside a Static Method, I have no idea how to get a DbContext, because there is no ServiceProvider. Is there a way to get the ServiceProvider ?

2 Answers
Related