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
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
2 Answer(s)
-
0
According to the framework rules, you cannot disable the
UnitOfworkpipeline. The only reason to disable theUnitOfWorkis managing theUnitOfWorkon your own withIUnitOfWorkManagerwith 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
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
