Skip to content

Adding Async versions of the overridden methods#80

Merged
JJBussert merged 1 commit into
e13tech:mainfrom
JJBussert:main
Apr 22, 2025
Merged

Adding Async versions of the overridden methods#80
JJBussert merged 1 commit into
e13tech:mainfrom
JJBussert:main

Conversation

@JJBussert
Copy link
Copy Markdown
Contributor

This pull request refactors the SavingChanges methods in three database interceptors (CreatableInterceptor, ModifiableInterceptor, and SoftDeleteInterceptor) to improve code reuse and add asynchronous support. The changes include introducing a shared HandleEventData method in each class and implementing the SavingChangesAsync method for better handling of asynchronous database operations.

Refactoring for code reuse and consistency:

  • Extracted shared logic into a new HandleEventData method in CreatableInterceptor, ModifiableInterceptor, and SoftDeleteInterceptor to handle entity state changes consistently. This method processes the ChangeTracker entries based on the specific entity types (ICreatable, IModifiable, IDeletable) and updates their audit fields. [1] [2] [3]

Asynchronous support:

  • Added SavingChangesAsync methods to all three interceptors (CreatableInterceptor, ModifiableInterceptor, SoftDeleteInterceptor) to handle asynchronous database save operations, leveraging the CancellationToken parameter for cancellation support. [1] [2] [3]

Minor improvements:

  • Renamed the data parameter to eventData in SavingChanges methods for better clarity and alignment with naming conventions. [1] [2] [3]

@JJBussert JJBussert merged commit 5d563eb into e13tech:main Apr 22, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant