Commit Graph

16 Commits

Author SHA1 Message Date
9bdf24d7d5 Refactor MediatorExtensions to fluent GetOr/Throw API
Replaced GetOrThrow methods with a fluent GetOr/Throw pattern for handling null or empty MediatR responses. Introduced GetOrContext<TResponse> struct with Throw, ThrowNotFound, ThrowInvalidOperation, and ThrowBadRequest methods. Updated all tests to use the new API and added coverage for new exception types. Improved XML docs and performed minor code cleanup.
2026-04-08 15:26:23 +02:00
993ca82596 Rename MediatR extensions to GetOrThrow for ISender
Renamed SendOrThrowAsync and SendOrNotFoundAsync extension methods for IMediator to GetOrThrow for ISender, following MediatR best practices. Updated all usages, XML docs, and tests to use ISender and the new method names. Replaced StubMediator with StubSender in tests. Functionality remains the same, but code now aligns with modern MediatR conventions.
2026-04-08 14:01:24 +02:00
6c54473d5a Refactor MediatorExtensions for flexible exception handling
Generalize null/empty response handling with SendOrThrowAsync<TResponse, TException>, allowing custom exceptions via a factory delegate. SendOrNotFoundAsync now wraps this method for NotFoundException. Improves type safety, flexibility, and XML docs; avoids treating strings as collections.
2026-04-08 13:44:19 +02:00
9ad4352e02 Add MediatorExtensions for not-found handling in MediatR
Introduced MediatorExtensions with SendOrNotFoundAsync methods to enforce non-null and non-empty responses from MediatR requests. These extensions throw NotFoundException when responses are null or empty, centralizing not-found logic and improving error handling.
2026-04-08 13:25:34 +02:00
03e3e0eaf4 Add IHasChangedWhen support and cleanup using statements
Introduced IHasChangedWhen interface to EnvelopeReceiver and History.
Added HasEmailAndName property to EnvelopeReceiver.
Updated AutoMapperAuditingExtensions to map ChangedWhen to UTC.
Removed redundant using statements and fixed formatting.
2026-02-11 10:31:22 +01:00
d31916eab8 Add AutoMapper auditing extensions for timestamp fields
Introduced AutoMapperAuditingExtensions with MapAddedWhen and MapChangedWhen methods to standardize mapping of auditing timestamps. Refactored MappingProfile to use these extensions for AddedWhen and ChangedWhen fields, improving code clarity. Updated DocumentStatus to implement auditing interfaces and added necessary imports.
2026-02-11 10:22:49 +01:00
75846573da Add XML docs and standardize repository access patterns
Added XML documentation to extension and handler classes for improved maintainability. Refactored repository access to use .Query instead of .ReadOnly() for consistency. Updated async extension methods for better readability and error handling.
2026-02-02 10:07:50 +01:00
6f16921a79 Remove Obsolete attributes and update FirstAsync behavior
Removed Obsolete attributes from FirstAsync and Exceptions class. Changed FirstAsync return type to non-nullable Task<T> and updated its logic to throw the provided exception when the sequence is empty, instead of returning null.
2026-01-30 14:41:54 +01:00
1afc95f9c6 Add obsolete FirstAsync extension to TaskExtensions
Added FirstAsync<T, TException> as an obsolete extension method for Task<IEnumerable<T>>. This method returns the first element or throws a custom exception if the result is null, using a provided factory delegate. Intended for legacy .NET projects.
2026-01-30 14:24:57 +01:00
6aed820196 Mark TaskExtensions and new helpers as [Obsolete]
Marked TaskExtensions class and all its methods as [Obsolete] with guidance to implement Mediator behaviors instead. Added new [Obsolete] extension methods for null/empty checks and chaining. Introduced an [Obsolete] Exceptions class with factory methods for common exceptions. All changes are intended for legacy or transitional use only.
2026-01-30 14:20:05 +01:00
991943d6bd refactor(SendMailHandler): remove TextToHtml 2025-09-15 14:23:48 +02:00
95b54fa1f1 feat(JsonExtensions): create to be able to make fluent Json serilization 2025-09-10 15:55:56 +02:00
6b89b9bbf2 refactor(ModifyDocStatusCommandBase): add EnvelopeId and ReceiverId properties 2025-09-09 23:15:19 +02:00
248c5bce5a refactor(Common.Model): rename as Common.Query 2025-09-09 19:39:50 +02:00
c76a772768 fix references 2025-09-09 19:23:04 +02:00
fbfc20705d refactor(Extensions): move to common 2025-09-09 18:26:06 +02:00