EndpointReference Methods
ClassMethods4 members
Represents an endpoint reference for a resource with endpoints.
GetTlsValue(ReferenceExpression, ReferenceExpression)Section titled GetTlsValue(ReferenceExpression, ReferenceExpression)ReferenceExpression Creates a conditional
ReferenceExpression that resolves to enabledValue when EndpointAnnotation.TlsEnabled is true on this endpoint, or to disabledValue otherwise. public sealed class EndpointReference{ public ReferenceExpression GetTlsValue( ReferenceExpression enabledValue, ReferenceExpression disabledValue) { // ... }}Parameters
enabledValueReferenceExpressionThe expression to evaluate when TLS is enabled (e.g., ",ssl=true").disabledValueReferenceExpressionThe expression to evaluate when TLS is not enabled.Returns
ReferenceExpressionA conditional ReferenceExpression whose value tracks the TLS state of this endpoint.Remarks
The returned expression evaluates the TLS state lazily each time its value is resolved, making it safe to embed in a
ReferenceExpression that is built before TLS is configured (e.g., before BeforeStartEvent fires). Because the condition and branches are declarative, polyglot code generators can translate this into native conditional constructs in any target language. Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
public sealed class EndpointReference{ public ValueTask<string?> GetValueAsync( CancellationToken cancellationToken = default(CancellationToken)) { // ... }}Parameters
cancellationTokenCancellationTokenoptionalThe cancellation token.Returns
ValueTask<string?>The URL of the endpoint.GetValueAsync(ValueProviderContext, CancellationToken)Section titled GetValueAsync(ValueProviderContext, CancellationToken)ValueTask<string?> Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
public sealed class EndpointReference{ public ValueTask<string?> GetValueAsync( ValueProviderContext context, CancellationToken cancellationToken = default(CancellationToken)) { // ... }}Parameters
contextValueProviderContextThe context for value resolution.cancellationTokenCancellationTokenoptionalThe cancellation token.Returns
ValueTask<string?>The URL of the endpoint. Gets the specified property expression of the endpoint.
public sealed class EndpointReference{ public EndpointReferenceExpression Property( EndpointProperty property) { // ... }}Parameters
propertyEndpointPropertyThe EndpointProperty enum value to use in the reference.Returns
EndpointReferenceExpressionAn EndpointReferenceExpression representing the specified EndpointProperty.