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

Replace IsDisposable with Dispose + Refactor #26

Closed
mariusz96 opened this issue Oct 26, 2024 · 0 comments
Closed

Replace IsDisposable with Dispose + Refactor #26

mariusz96 opened this issue Oct 26, 2024 · 0 comments

Comments

@mariusz96
Copy link
Contributor

mariusz96 commented Oct 26, 2024

As noted in #19 (comment), IsDisposable gets replaced with Dispose:

public class MiddlewareResolverResult
{
-    /// <summary>
-    /// Gets or sets the value indicating whether the middleware should be disposed.
-    /// Set this to <see langword="true"/> if the middleware is IDisposable or
-    /// IAsyncDisposable (requires .NET Standard 2.1 or greater)
-    /// and is not disposed by a dependency injection container.
-    /// </summary>
-    public bool IsDisposable { get; set; }

+    /// <summary>
+    /// Gets or sets the value indicating whether the middleware should be disposed.
+    /// Set this to <see langword="true"/> if the middleware is not disposed
+    /// by a dependency injection container.
+    /// </summary>
+    public bool Dispose { get; set; }
}

and it is no longer needed to check if middleware implements IDisposable/IAsyncDisposable in IMiddlewareResolver implementations.

And I refactored stuff for readability and less code duplication.

@mariusz96 mariusz96 changed the title Replace MiddlewareResult.IsDisposable with MiddlewareResult.Dispose + Refactor Replace IsDisposable with Dispose + Refactor Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant