Example #1
0
        public override void StaticGenericModelCache(SqlModel model, Type type)
        {
            GsOperator gs = new GsOperator(typeof(SqlModel <>), type);

            gs.Set("PrimaryKey", model.PrimaryKey);
            gs.Set("TableName", model.TableName);
            gs.Set("Left", model.Left);
            gs.Set("Right", model.Right);
            gs.Set("Members", model.Members);
            gs.Set("ColumnMapping", model.ColumnMapping);
            gs.Set("OperatorType", model.OperatorType);
        }
Example #2
0
        /// <summary>
        /// 生成静态缓存
        /// </summary>
        /// <param name="type"></param>
        public void StaticGenericCache(Type type)
        {
            //静态sql生成器。例如 MakerModel<Student>
            GsOperator gs = new GsOperator(typeof(SqlModel <>), type);

            gs.Set("PrimaryKey", PrimaryKey);
            gs.Set("TableName", TableName);
            gs.Set("Left", Left);
            gs.Set("Right", Right);
            gs.Set("Members", Members);
            gs.Set("ColumnMapping", ColumnMapping);
            gs.Set("OperatorType", OperatorType);
        }
Example #3
0
        public void TestTwoStatic()
        {
            var operator1 = new GsOperator <SqlEntity <GenericType>, int>();

            operator1.Set("SelectAll", "MsSqlOne");


            var operator2 = new GsOperator <SqlEntity <GenericType>, string>();

            operator2.Set("InsertAll", "MySqlOne");


            Assert.Equal("MsSqlOne", SqlEntity <int> .SelectAll);
            Assert.Equal("MySqlOne", SqlEntity <string> .InsertAll);
        }
Example #4
0
        public void TestOneStatic()
        {
            var operator1 = new GsOperator <SqlEntity <GenericType> >(typeof(int));

            operator1.Set("SelectAll", "MsSqlOne");


            var operator2 = new GsOperator <SqlEntity <GenericType> >(typeof(string));

            operator2.Set("SelectAll", "MySqlOne1");


            Assert.Equal("MsSqlOne", SqlEntity <int> .SelectAll);
            Assert.Equal("MySqlOne1", SqlEntity <string> .SelectAll);
        }
Example #5
0
        public void TesZeroStatic()
        {
            var operator1 = new GsOperator(typeof(SqlEntity <>), typeof(int));

            operator1.Set("SelectAll", "MsSqlOne");


            var operator2 = new GsOperator(typeof(SqlEntity <>), typeof(string));

            operator2.Set("InsertAll", "MySqlOne");


            Assert.Equal("MsSqlOne", SqlEntity <int> .SelectAll);
            Assert.Equal("MySqlOne", SqlEntity <string> .InsertAll);
        }