LogtoConnectionStringHelper Methods
ClassMethods1 member
Provides utility methods for extracting and validating endpoint information from connection strings in various formats. This helper is specifically designed to assist with parsing connection strings for use with the Logto client configuration.
GetEndpointFromConnectionString(string?)Section titled GetEndpointFromConnectionString(string?)staticnullablestring? Retrieves the endpoint value from a given connection string. If the connection string is a valid URI, the method returns the URI as a string. If the connection string is in a key-value pair format, it extracts the value of the "Endpoint" key if present and validates it as a URI.
public static class LogtoConnectionStringHelper{ public static string? GetEndpointFromConnectionString( string? connectionString) { // ... }}Parameters
connectionStringstring?The connection string to parse for an endpoint.Returns
string? A string representation of the endpoint if found and valid; otherwise, null if the connection string is null, empty, or does not contain a valid endpoint.