ASP.NET에서 인증 필터를 만들어 쓰는데 DbContext 에러가 났다.
ASP.NET에서 인증 필터를 만들어 쓰는데 DbContext 에러가 났다. 어처구니 없는 실패 ASP.NET에서 권한 레벨 기능을 도입하는 중에 IAuthorizationFilter를 구현한 커스텀 필터를 제작해 사용하려 했는데, 다음과 같은 에러가 지속적으로 발생했다. System . InvalidOperationException : A second operation was started on this context instance before a previous operation completed . This is usually caused by different threads concurrently using the same instance of DbContext . For more information on how to avoid threading issues with DbContext , see https : / / go . microsoft . com / fwlink / ? linkid = 2097913 . at Microsoft . EntityFrameworkCore . Infrastructure . Internal . ConcurrencyDetector . EnterCriticalSection ( ) at Microsoft . EntityFrameworkCore . Query . Internal . SingleQueryingEnumerable` 1 . AsyncEnumerator . MoveNextAsync ( ) at Microsoft . EntityFrameworkCore . EntityFrameworkQueryableExtensions . ToListAsync [ TSource ] ( IQueryable` 1 source , CancellationToken cancellationToken ) at Microsoft . EntityFrameworkCore . EntityFram