Exemplo n.º 1
0
        public ConnectionString(ConnectionScheme scheme, [NotNull] IEnumerable <string> hosts, ushort?port)
        {
            if (!Enum.IsDefined(typeof(ConnectionScheme), scheme))
            {
                #if NETSTANDARD15
                throw new ArgumentException(nameof(scheme), "Invalid connection scheme");
                #else
                throw new InvalidEnumArgumentException(nameof(scheme), (int)scheme, typeof(ConnectionScheme));
                #endif
            }
            if (hosts == null)
            {
                throw new ArgumentNullException(nameof(hosts));
            }

            Scheme = scheme;
            Hosts  = new ReadOnlyCollection <string>(hosts.ToList());
            Port   = port;
        }
 public WatcherHttpRequestDescriptor Scheme(ConnectionScheme scheme)
 {
     Self.Scheme = scheme;
     return this;
 }
Exemplo n.º 3
0
 /// <inheritdoc />
 public WebhookActionDescriptor Scheme(ConnectionScheme scheme) => Assign(a => a.Scheme = scheme);
Exemplo n.º 4
0
 public WatcherHttpRequestDescriptor Scheme(ConnectionScheme scheme)
 {
     Self.Scheme = scheme;
     return(this);
 }
Exemplo n.º 5
0
 /// <inheritdoc />
 public HttpInputRequestDescriptor Scheme(ConnectionScheme scheme) => Assign(a => a.Scheme = scheme);
Exemplo n.º 6
0
 public ConnectionString(ConnectionScheme scheme, IEnumerable <string> hosts)
     : this(scheme, hosts, null)
 {
 }