Skip to content

Add Option to disable RevalidationInterceptor for Delete operation#4710

Merged
rockfordlhotka merged 5 commits into
mainfrom
delete-operation-does-not-trigger-revalidation
Jul 22, 2025
Merged

Add Option to disable RevalidationInterceptor for Delete operation#4710
rockfordlhotka merged 5 commits into
mainfrom
delete-operation-does-not-trigger-revalidation

Conversation

@StefanOssendorf

Copy link
Copy Markdown
Contributor

Adds a new option class RevalidatingInterceptorOptions which can be configured through the Options pattern.

With this new option it's possible to suppress/avoid the revalidation of objects when performing a Delete operation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RevalidatingInterceptorOptions class with an IgnoreDeleteOperation property
  • Updates the RevalidatingInterceptor constructor to accept IOptions<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

Comment thread docs/Upgrading to CSLA 10.md Outdated
@rockfordlhotka rockfordlhotka merged commit 6431a64 into main Jul 22, 2025
3 checks passed
@rockfordlhotka rockfordlhotka deleted the delete-operation-does-not-trigger-revalidation branch July 22, 2025 19:44
@github-project-automation github-project-automation Bot moved this from In Progress to Done in CSLA Version 10.0.0 Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

3 participants