-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Adds an overload to RegisterBeforeDispose() #16322
Conversation
…at the end of the list.
internal void BeforeDispose(Func<ShellScope, Task> callback) => (_beforeDispose ??= []).Insert(0, callback); | ||
internal void BeforeDispose(Func<ShellScope, Task> callback, bool last) | ||
{ | ||
var list = _beforeDispose ??= []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better than a separate collection like I suggested.
Why the new local list
though? and not just use _beforeDispose
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just personal habit...
Nice, that will do the trick thanks. |
src/OrchardCore/OrchardCore.Abstractions/Shell/Scope/ShellScopeExtensions.cs
Show resolved
Hide resolved
…eExtensions.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
Anybody with any further remarks? |
What about this comment? |
@hishamco it's about style ... already spent too much time just asking the question ;) |
Adds an overload to RegisterBeforeDispose() to allow adding callbacks at the end of the list.
Fixes #16306