Add Option to disable RevalidationInterceptor for Delete operation#4710
Merged
rockfordlhotka merged 5 commits intoJul 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new configuration option to disable the RevalidatingInterceptor during Delete operations. The implementation uses the .NET Options pattern to allow developers to suppress business rule revalidation when deleting objects, which can be useful in scenarios where validation is unnecessary or problematic during deletion.
Key changes:
- Introduces a new
RevalidatingInterceptorOptionsclass with anIgnoreDeleteOperationproperty - Updates the
RevalidatingInterceptorconstructor to acceptIOptions<RevalidatingInterceptorOptions> - Modifies the interceptor logic to skip revalidation when the option is enabled and the operation is a Delete
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| RevalidatingInterceptorOptions.cs | New options class defining the IgnoreDeleteOperation configuration property |
| RevalidatingInterceptor.cs | Updated constructor and logic to support configurable Delete operation handling |
| DataPortalConfigurationExtensions.cs | Registers the new options class with the DI container |
| Csla.csproj | Adds Microsoft.Extensions.Options package references for multiple target frameworks |
| RevalidatingInterceptorTests.cs | Refactored tests and added new test for the Delete operation skip functionality |
| TestDIContextFactory.cs | Enhanced factory methods to support custom service configuration |
| Upgrading to CSLA 10.md | Documents the breaking change and new configuration option |
Co-authored-by: Copilot <[email protected]>
rockfordlhotka
approved these changes
Jul 22, 2025
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.
Adds a new option class
RevalidatingInterceptorOptionswhich can be configured through the Options pattern.With this new option it's possible to suppress/avoid the revalidation of objects when performing a
Deleteoperation.