.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()。

原文地址:.NET Core Entity Framework Core 多线程中使用Context报错问题

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!