HttpEndpointAttribute

Specifies that a configuration property represents an HTTP endpoint URL for an HttpClient. Used by the EasyAF configuration system to automatically register HttpClients with their base addresses.

Syntax

[AttributeUsage(AttributeTargets.Property)]
public class HttpEndpointAttribute : Attribute

Inheritance

Constructors

HttpEndpointAttribute

public HttpEndpointAttribute(string clientNameProperty)
Initializes a new instance of the class.

Parameters

  • clientNameProperty string: The name of the property that contains the HttpClient name for registration.

Exceptions

  • [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): Thrown when clientNameProperty is null.

Properties

ClientNameProperty

public string ClientNameProperty { get; set; }
Gets or sets the name of the property that contains the HttpClient name to be registered. This property should contain the string value that will be used as the named HttpClient identifier.

Returns

string

Remarks

This attribute enables automatic HttpClient registration by linking configuration properties that contain URLs to the corresponding HttpClient name properties. The configuration system uses this information to set up named HttpClient instances with appropriate base addresses.