コード例 #1
0
        public Connection Get(IConfiguration configuration, string serviceName)
        {
            var info = serviceName == null
            ? configuration.GetSingletonServiceInfo <SqlServerServiceInfo>()
            : configuration.GetRequiredServiceInfo <SqlServerServiceInfo>(serviceName);

            var sqlConfig  = new SqlServerProviderConnectorOptions(configuration);
            var configurer = new SqlServerProviderConfigurer();

            return(new Connection
            {
                ConnectionString = configurer.Configure(info, sqlConfig),
                Name = "SqlServer" + serviceName?.Insert(0, "-")
            });
        }