public static void Config()
        {
            string ConnectionString   = "Data Source=(Local);Initial Catalog=Northwind;User ID=test;Password=test";
            var    connectionProvider = new ConnectionStringConnectionProvider(ConnectionString);

            MsSqlRepoFactory.UseConnectionProvider(connectionProvider);
        }
        public static void Config()
        {
            string ConnectionString   = "datasource=127.0.0.1;username=test;password=test;database=northwind;charset=gb2312;SslMode = none;";
            var    connectionProvider = new ConnectionStringConnectionProvider(ConnectionString);

            MySqlRepoFactory.UseConnectionProvider(connectionProvider);
        }
        /// <summary>
        /// init
        /// 创建初始方法,初始一个工厂类。
        /// </summary>
        static void Init()
        {
            // Set Connection String
            string ConnectionString   = "Data Source=(Local);Initial Catalog=Northwind;User ID=test;Password=test";
            var    connectionProvider = new ConnectionStringConnectionProvider(ConnectionString);

            MsSqlRepoFactory.UseConnectionProvider(connectionProvider);

            // this Demo is POJO ,So Using SimpleWritablePropertyMatcher()。
            // 本例中,使用的是简单类,所以用SimpleWritablePropertyMatcher()来操作属性。
            MsSqlRepoFactory.UseWritablePropertyMatcher(new SimpleWritablePropertyMatcher());
        }
Exemple #4
0
        public AzNormalSet()
        {
            //AzBaseSet baseSet = AzBaseSet.GetBaseSet();
            //baseSet.AzConnectionString = dialog.ConnectionString;
            var connectionString = AzBase.AzConnectionString;
            ConnectionStringConnectionProvider connectionProvider = new ConnectionStringConnectionProvider(connectionString);

            if (connectionProvider != null)
            {
                RepoFactory.UseConnectionProvider(connectionProvider);
                RepoFactory.UseLogger(new NoOpSqlLogger());
            }
        }