You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a problem related to the CommandHandlers
the following will work totally fine at the first shot. def.ExecuteMethod ??= def.HandlerType.HandlerExecutor(tCommand, handler);
However, if you have any scoped disposable dependencies like DbContext, they will be disposed after the first execution, and because the ExecuteMethod is cached it will try to reuse them again so you'll get an exception.
if we called the def.HandlerType.HandlerExecutor(tCommand, handler); on each execution the problem will be solved.
does it harm the performance a lot to call the HandlerExecutor on each execution?
The text was updated successfully, but these errors were encountered:
can you try v5.3.2.6-beta
issue is fixed but lost a bit of performance because i couldn't figure out the correct expression tree for the needed logic.
will try again in a couple of days with a fresh mindset.
this will have to do for now.
Related to this discord discussion
I ran into a problem related to the CommandHandlers
the following will work totally fine at the first shot.
def.ExecuteMethod ??= def.HandlerType.HandlerExecutor(tCommand, handler);
However, if you have any scoped disposable dependencies like DbContext, they will be disposed after the first execution, and because the ExecuteMethod is cached it will try to reuse them again so you'll get an exception.
if we called the
def.HandlerType.HandlerExecutor(tCommand, handler);
on each execution the problem will be solved.does it harm the performance a lot to call the HandlerExecutor on each execution?
The text was updated successfully, but these errors were encountered: