最近发现一个 ASP.NET Core 项目的日志中有时会出现下面的错误:
2025-10-09 13:01:14.976 [Error] An exception occurred while iterating over the results of a query for context type 'Cnblogs.Infrastructure.Data.EfUnitOfWork'.
System.InvalidOperationException: Invalid operation. The connection is closed.
...
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
请问如何解决这个问题?