0
alper created
Support Team
Director
Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: XXXX
System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'WebPlatformDbContext'.
@jackmcelhinney asks here
2 Answer(s)
-
0
let us check it. subscribe the question to get email notification
-
0
According to the framework rules, you cannot disable the
UnitOfwork
pipeline. The only reason to disable theUnitOfWork
is managing theUnitOfWork
on your own withIUnitOfWorkManager
with the following codeusing (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false )) { //..... await uow.CompleteAsync(); }
You might want to disable transaction for the corresponding method. To do this basically add the following attribute
[UnitOfWork(isTransactional: false)]
If you really want to disable the
UnitOfWork
, you can useFindAsync()
instead ofFirstOrDefaultAsync()
Related document https://docs.abp.io/en/abp/latest/Unit-Of-Work