public static EndpointSetting GetXmlEndpointSetting(this IConfigurationBuilder builder, string basePath, string fileName) { var config = builder .SetBasePath(basePath) .AddXmlFile(fileName, optional: false, reloadOnChange: false) .Build(); var endpoint = new EndpointSetting(); config.GetSection(typeof(EndpointSetting).Name).Bind(endpoint); return(endpoint); }
public void SetEndpoint(EndpointSetting endpoint, string value) { endpoint.Previous = endpoint.Value; endpoint.Value = new Uri(value); }
public void SwitchEndpoint(EndpointSetting endpoint) { (endpoint.Value, endpoint.Previous) = (endpoint.Previous, endpoint.Value); }