internal static IDbConnection CreateWorkflowConnection()
        {
            SmartflowConfiguration config = ConfigurationManager.GetSection("smartflowConfiguration") as
                                            SmartflowConfiguration;

            return(DapperFactory.CreateConnection(config.ProviderName, config.ConnectionString));
        }
Esempio n. 2
0
        public static IDbConnection CreateWorkflowConnection()
        {
            SmartflowConfiguration config = ConfigurationManager.GetSection("smartflowConfiguration") as
                                            SmartflowConfiguration;

            Assert.CheckNull(config, "SmartflowConfiguration");
            return(DapperFactory.CreateConnection(config.ProviderName, config.ConnectionString));
        }
Esempio n. 3
0
        public static IDbConnection CreateWorkflowConnection()
        {
            SmartflowConfiguration config = ConfigurationManager.GetSection("smartflowConfiguration") as SmartflowConfiguration;

            Assert.CheckNull(config, "smartflowConfiguration");
            Assert.StringNull(config.ConnectionString, "ConnectionString");
            Assert.StringNull(config.DatabaseCategory, "DatabaseCategory");

            DatabaseCategory dbc;

            if (Enum.TryParse(config.DatabaseCategory, true, out dbc) || String.IsNullOrEmpty(config.ConnectionString))
            {
                return(DapperFactory.CreateConnection(dbc, config.ConnectionString));
            }
            else
            {
                throw new WorkflowException(ResourceManage.GetString(ResourceManage.CONNECTION_CONFIG));
            }
        }