From bbfff226ded642e4faa9b8a07ccab7617447ecfd Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 27 Nov 2025 14:37:35 +0100 Subject: [PATCH] Add ToEndpointUriBuilder method to RecActionDto Introduce the ToEndpointUriBuilder() method in the RecActionDto class to simplify the creation of a UriBuilder object. The method configures the UriBuilder based on the EndpointUri and ProfileType properties, setting the port to -1 and the scheme to ProfileType if provided. This enhances the flexibility and usability of the RecActionDto class for endpoint URI construction. --- src/ReC.Application/Common/Dto/RecActionDto.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ReC.Application/Common/Dto/RecActionDto.cs b/src/ReC.Application/Common/Dto/RecActionDto.cs index 717b350..dab3718 100644 --- a/src/ReC.Application/Common/Dto/RecActionDto.cs +++ b/src/ReC.Application/Common/Dto/RecActionDto.cs @@ -57,4 +57,16 @@ public record RecActionDto public string? BodyQuery { get; init; } public string? PostprocessingQuery { get; init; } + + public UriBuilder ToEndpointUriBuilder() + { + var builder = EndpointUri is null ? new UriBuilder() : new UriBuilder(EndpointUri); + + builder.Port = -1; + + if (ProfileType is not null) + builder.Scheme = ProfileType; + + return builder; + } } \ No newline at end of file