我看到ServiceProvder.GetService<ApplicationDbCotnext>()defaut 模板用于 初始化DbContext,但当你在静态方法中,我不知道如何获得DbContext,因为没有ServiceProvider.有办法搞定ServiceProvider吗?
ServiceProvder.GetService<ApplicationDbCotnext>()
DbContext
ServiceProvider
dependency-injection asp.net-core
asp.net-core ×1
dependency-injection ×1