public static async Task <IClusterClient> Connect() { IClientBuilder clientBuilder = new Orleans.ClientBuilder() .Configure <ClusterOptions>(options => { options.ClusterId = "dev"; options.ServiceId = "HelloWorldApp"; }) .UseAdoNetClustering(options => { options.Invariant = "System.Data.SqlClient"; options.ConnectionString = "Data Source=researchdb;Initial Catalog=OrleDb;Persist Security Info=True;User ID=sa;Password=OrleDBP@asswor1d"; }) .ConfigureLogging(builder => builder.SetMinimumLevel(LogLevel.Warning).AddConsole()); IClusterClient client = clientBuilder.Build(); await client.Connect(RetryFilter); return(client); }
private static void InternalInitialize(ClientConfiguration config) { var builder = new ClientBuilder() .ConfigureApplicationParts(parts => parts.ConfigureDefaults()) .UseConfiguration(config) .ConfigureLogging(ConfigureLoggingDelegate); ConfigureClientDelegate?.Invoke(builder); var clusterClient = (IInternalClusterClient)builder.Build(); if (TestOnlyNoConnect) { Trace.TraceInformation("TestOnlyNoConnect - Returning before connecting to cluster."); } else { // Finish initializing this client connection to the Orleans cluster DoInternalInitialize(clusterClient); } }