Exemplo n.º 1
0
        public static async Task <ICluster> ConnectAsync(string connectionString, ClusterOptions?options = null)
        {
            var cluster = new Cluster(connectionString, options);
            await cluster.InitializeAsync().ConfigureAwait(false);

            return(cluster);
        }
Exemplo n.º 2
0
 public static ICluster Connect(string connectionString, ClusterOptions options)
 {
     using (new SynchronizationContextExclusion())
     {
         var cluster = new Cluster(connectionString, options);
         cluster.InitializeAsync().GetAwaiter().GetResult();
         return(cluster);
     }
 }
Exemplo n.º 3
0
        public static ICluster Connect(string connectionString, ClusterOptions options)
        {
            using (new SynchronizationContextExclusion())
            {
                var cluster = new Cluster(connectionString, options);
#pragma warning disable Await1 // Method is not configured to be awaited
                Task.Run(async() => await cluster.InitializeAsync());
#pragma warning restore Await1 // Method is not configured to be awaited
                return(cluster);
            }
        }