コード例 #1
0
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        public virtual CosmosOptionsExtension WithPortReuseMode(PortReuseMode portReuseMode)
        {
            var clone = Clone();

            clone._portReuseMode = portReuseMode;

            return(clone);
        }
コード例 #2
0
 public RntbdConnectionConfig(
     int connectionTimeout,
     int idleConnectionTimeout,
     int maxRequestsPerChannel,
     int maxRequestsPerEndpoint,
     bool tcpEndpointRediscovery,
     PortReuseMode portReuseMode)
 {
     this.ConnectionTimeout      = connectionTimeout;
     this.IdleConnectionTimeout  = idleConnectionTimeout;
     this.MaxRequestsPerChannel  = maxRequestsPerChannel;
     this.MaxRequestsPerEndpoint = maxRequestsPerEndpoint;
     this.TcpEndpointRediscovery = tcpEndpointRediscovery;
     this.PortReuseMode          = portReuseMode;
     this.lazyString             = new Lazy <string>(() => string.Format(CultureInfo.InvariantCulture,
                                                                         "(cto: {0}, icto: {1}, mrpc: {2}, mcpe: {3}, erd: {4}, pr: {5})",
                                                                         connectionTimeout,
                                                                         idleConnectionTimeout,
                                                                         maxRequestsPerChannel,
                                                                         maxRequestsPerEndpoint,
                                                                         tcpEndpointRediscovery,
                                                                         portReuseMode.ToString()));
     this.lazyJsonString = new Lazy <string>(() => Newtonsoft.Json.JsonConvert.SerializeObject(this));
 }
コード例 #3
0
 /// <summary>
 ///     Configures the client port reuse policy used by the transport stack.
 /// </summary>
 /// <param name="portReuseMode"> The client port reuse policy used by the transport stack. </param>
 public virtual CosmosDbContextOptionsBuilder PortReuseMode(PortReuseMode portReuseMode)
 => WithOption(e => e.WithPortReuseMode(Check.NotNull(portReuseMode, nameof(portReuseMode))));