示例#1
0
 public async Task <int> SavePunchInDatabase(Punch punchToSave)
 {
     using (IDbConnection connection = new SqlConnection(SiloConfigurationProvider.GetConfig().ConnectionString))
     {
         connection.Open();
         return(await connection.InsertAsync(punchToSave));
     }
 }
示例#2
0
        private static async Task <ISiloHost> StartSilo3()
        {
            ISiloConfiguration config = SiloConfigurationProvider.GetConfig();

            // define the cluster configuration
            var builder = new SiloHostBuilder();
            //	.UseLocalhostClustering()
            //	.Configure<ClusterOptions>( options => { options = config.ClusterConfig; })
            //	.Configure<EndpointOptions>(options => { options = config.EndPointConfig; })
            //	.Configure<AdoNetClusteringSiloOptions>(options => { options = config.ClusterDatabaseConfig; })
            //	//.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(HelloGrain).Assembly).WithReferences())
            //	.ConfigureLogging(logging =>
            //	{
            //		logging.AddNLog();
            //		logging.AddConsole();
            //	});

            var host = builder.Build();
            await host.StartAsync();

            return(host);
        }