[英]aspnet core - DI dbcontext to jsonconverter
Is it possible? 可能吗? I saw two threads but all of them only have workaround solutions.
我看到了两个线程,但是它们都只有解决方法。 I tried the static but the
dbcontext
got dirty after first post and gave out exception something like change tracker already track the entity. 我尝试了静态方法,但是
dbcontext
在第一次发布后变得肮脏,并且发出了类似更改跟踪器已跟踪实体的异常。 The 2nd thread, I failed to make it work. 第二个线程,我无法使其正常工作。
我发现帖子中的答案属于Andrew Lock https://andrewlock.net/accessing-services-when-configuring-mvcoptions-in-asp-net-core/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.