* Added "LazyInitialize" property to "HandlerDescriptor" to make post-creation operation (required for BranchingHandler)
* Tweaked "HandlersProvider" implementation to fit new HandlerDescriptor property * Fixed "BranchingHandler"'s descriptor creation logic
This commit is contained in:
@@ -49,6 +49,7 @@ namespace Telegrator.Hosting.Providers
|
||||
if (handlerInstance is not UpdateHandlerBase updateHandler)
|
||||
throw new InvalidOperationException("Failed to resolve " + descriptor.HandlerType + " as UpdateHandlerBase");
|
||||
|
||||
descriptor.LazyInitialization?.Invoke(updateHandler);
|
||||
updateHandler.LifetimeToken.OnLifetimeEnded += _ => scope.Dispose();
|
||||
return updateHandler;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user