.NET Core Entity Framework Core 多线程中使用Context报错问题
时间:2021-06-22 18:13:41
收藏:0
阅读:0
本文主要介绍Entity Framework Core在ASP.NET Core中,多个请求中使用同一个context问题,Entity Framework Core上下文(context)不能在多线程中使用,多个请求其实就是多个线程。报错信息:InvalidOperationException: A second operation started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe.Microsoft.EntityFrameworkCore.Internal.ConcurrencyDetector.EnterCriticalSection()。
评论(0)