public static string BuildEndpointUri(this NamedService service, string endpointName, HttpServiceUriTarget target, long partitionKey, EndpointScheme scheme = EndpointScheme.HTTP) { return(BuildEndpointUri(service, endpointName, target, new ServicePartitionKey(partitionKey), scheme.ToString())); }
public void SetTarget(HttpServiceUriTarget uriTarget) { HttpServiceUriBuilder target = new HttpServiceUriBuilder() .SetServiceName("fabric:/test") .SetTarget(uriTarget); Assert.Equal <HttpServiceUriTarget>(uriTarget, target.Target); Assert.Equal <string>(this.GetUrl("http", "fabric", "test", target: uriTarget.ToString()), target.Build().ToString()); }
public HttpServiceUriBuilder SetTarget(HttpServiceUriTarget target) { this.Target = target; return(this); }
public void ConstructorGetTarget(HttpServiceUriTarget expectedTarget, string url) { HttpServiceUriBuilder target = new HttpServiceUriBuilder(url); Assert.Equal <HttpServiceUriTarget>(expectedTarget, target.Target); }
public HttpServiceUriBuilder SetTarget(HttpServiceUriTarget target) { this.Target = target; return this; }
private static string BuildEndpointUri(NamedService service, string endpointName, HttpServiceUriTarget target, ServicePartitionKey partitionKey, string scheme) { if (service == null) { throw new ArgumentNullException(nameof(service)); } if (string.IsNullOrEmpty(scheme)) { throw new ArgumentException(nameof(scheme)); } HttpServiceUriBuilder builder = new HttpServiceUriBuilder(); builder.SetScheme(scheme); builder.SetServiceName(service); builder.SetPartitionKey(partitionKey); builder.SetEndpointName(endpointName); builder.SetTarget(target); return(builder.Build().OriginalString); }