Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown from worker when executing generic crud command #108

Open
karpikpl opened this issue Mar 7, 2022 · 0 comments
Open

Exception thrown from worker when executing generic crud command #108

karpikpl opened this issue Mar 7, 2022 · 0 comments
Labels
bug Something isn't working need more info We need more info before acting on the issue.

Comments

@karpikpl
Copy link

karpikpl commented Mar 7, 2022

Exception:

fail: Liquid.Core.Implementations.LiquidTelemetryInterceptor[0]
Execution of UpdateAsync from Liquid.Repository.EntityFramework.EntityFrameworkRepository3[[Properties.Domain.Entities.Property, Properties.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Properties.Repository.PropertiesDbContext, Properties.Repository, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] has thrown an exception. 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: 'PropertiesDbContext'. at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed() at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies() at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Liquid.Repository.EntityFramework.EntityFrameworkRepository3.UpdateAsync(TEntity entity)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Liquid.Core.Base.LiquidInterceptorBase.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) Liquid.Core.Implementations.LiquidTelemetryInterceptor: Error: Execution of UpdateAsync from Liquid.Repository.EntityFramework.EntityFrameworkRepository3[[Properties.Domain.Entities.Property, Properties.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Properties.Repository.PropertiesDbContext, Properties.Repository, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] has thrown an exception.

Command throwing it from implementation of ILiquidWorker

 var updateResponse = await _mediator.Send(new UpdateGenericEntityCommand<Property, long>(property));

In 1Program.cs` repositories are registered:

services.RegisterCrud<Property, long>();
services.AddLiquidEntityFramework<PropertiesDbContext, Property, long>(options);
@lucianareginalino lucianareginalino added bug Something isn't working ready This issue has the solution defined and ready to be acted labels Mar 14, 2022
@lucianareginalino lucianareginalino added need more info We need more info before acting on the issue. and removed ready This issue has the solution defined and ready to be acted labels Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info We need more info before acting on the issue.
Projects
None yet
Development

No branches or pull requests

2 participants