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.
This commit is contained in:
parent
7a4885c86a
commit
bbfff226de
@ -57,4 +57,16 @@ public record RecActionDto
|
|||||||
public string? BodyQuery { get; init; }
|
public string? BodyQuery { get; init; }
|
||||||
|
|
||||||
public string? PostprocessingQuery { 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user