Add constructor overloads to override AllowMultipleDisposeCalls and AllowMultipleDisposeAttempts#95
Open
Add constructor overloads to override AllowMultipleDisposeCalls and AllowMultipleDisposeAttempts#95
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #35
…llowMultipleDisposeAttempts - Add constructor parameters to allow setting AllowMultipleDisposeCalls and AllowMultipleDisposeAttempts values directly instead of requiring inheritance - Add comprehensive tests to verify new constructor functionality - Fix DisposalOrderTest to use net8 target framework instead of net7 - Resolves issue #35: Add constructor that can override values of AllowMultipleDisposeCalls and AllowMultipleDisposeAttempts properties 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Oct 30, 2025
Member
Author
|
Hi! 👋 I'm investigating issue linksplatform/Data.Doublets#122, which depends on this PR being merged. This PR looks excellent - all tests pass, it's fully backward compatible, and it provides exactly the functionality requested in issue #35. Status check: Is there anything blocking this PR from being merged? Any changes needed, or is it just waiting for review? The Data.Doublets repository is ready to remove its workaround inner class as soon as:
Looking forward to seeing this feature available! Thanks for your work on this. 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the enhancement requested in issue #35 by adding constructor overloads to the
Disposableclass that allow directly setting theAllowMultipleDisposeCallsandAllowMultipleDisposeAttemptsproperties without requiring inheritance.Changes Made
New Constructor Overloads: Added optional parameters
allowMultipleDisposeCallsandallowMultipleDisposeAttemptsto all existing constructors:Disposable(Action action, bool allowMultipleDisposeCalls = false, bool allowMultipleDisposeAttempts = false)Disposable(Disposal disposal, bool allowMultipleDisposeCalls = false, bool allowMultipleDisposeAttempts = false)Disposable(bool allowMultipleDisposeCalls, bool allowMultipleDisposeAttempts = false)Property Overrides: Override the virtual properties
AllowMultipleDisposeCallsandAllowMultipleDisposeAttemptsto return constructor-provided values when set, falling back to base implementation when not.Comprehensive Tests: Added 6 new unit tests covering all constructor scenarios:
Bug Fix: Updated
DisposalOrderTestto use .NET 8 instead of .NET 7 target frameworkBefore (Required Inheritance Workaround)
After (Direct Constructor Usage)
Test Results
All tests pass (11/11):
Backward Compatibility
This change is fully backward compatible. All existing code will continue to work exactly as before, with the new parameters defaulting to
false(maintaining current behavior).🤖 Generated with Claude Code
Resolves #35