Пример #1
0
        private COASqlJoinData <T> MainJoinGeneator <T1>(Expression SetTables, object obj, COASqlJoinTypes type = COASqlJoinTypes.INNER, COADataBaseTypes databasetype = COADataBaseTypes.Sql)
        {
            var returnData = new COASqlJoinData <T>();

            returnData.DataBaseType = databasetype;
            returnData.TableName    = TableName;
            returnData.SetJoinType(type);
            var Column1Selected = Types.GetAllTypes(SetTables);
            var Selectedlist    = new List <string>();

            if (Column1Selected.Name.Count == 0)
            {
                var Types = GetGenericTypeList(obj);

                for (int i = 1; i < Types.Length; i++)
                {
                    var Props = Types[i].GetProperties();
                    foreach (var prop in Props)
                    {
                        Selectedlist.Add($"{prop.ReflectedType.Name}.{prop.Name}");
                    }
                }
            }
            else
            {
                Selectedlist = Types.JoinBaseGenerator(Column1Selected);
            }

            returnData.SelectedColumns = Selectedlist;
            returnData.SqlQuery        = Types.JoinSqlGenerator <T1>(returnData.SelectedColumns);
            return(returnData);
        }
Пример #2
0
        public COASqlJoinData <T, T1, T2, T3, T4, T5, T6, T7, T8> GenerateRightJoinQuery <T1, T2, T3, T4, T5, T6, T7, T8>(Expression <Func <T1, T2, T3, T4, T5, T6, T7, T8, object> > SetTables)
        {
            var RData = new COASqlJoinData <T, T1, T2, T3, T4, T5, T6, T7, T8>();

            RData.Add(MainJoinGeneator <T1>(SetTables, RData, COASqlJoinTypes.RIGHT, DataBaseType));
            return(RData);
        }
Пример #3
0
        public COASqlJoinData <T, T1, T2, T3, T4, T5, T6, T7> GenerateLeftJoinQuery <T1, T2, T3, T4, T5, T6, T7>(Expression <Func <T1, T2, T3, T4, T5, T6, T7, object> > SetTables = null)
        {
            var RData = new COASqlJoinData <T, T1, T2, T3, T4, T5, T6, T7>();

            RData.Add(MainJoinGeneator <T1>(SetTables, RData, COASqlJoinTypes.LEFT, DataBaseType));
            return(RData);
        }
Пример #4
0
        public COASqlJoinData <T, T1, T2, T3, T4, T5, T6> GenerateJoinQuery <T1, T2, T3, T4, T5, T6>(Expression <Func <T1, T2, T3, T4, T5, T6, object> > SetTables = null)
        {
            var RData = new COASqlJoinData <T, T1, T2, T3, T4, T5, T6>();

            RData.Add(MainJoinGeneator <T1>(SetTables, RData, databasetype: DataBaseType));
            return(RData);
        }
Пример #5
0
        private static COASqlJoinData <T> MainRemoveGeneator <T, T1>(COASqlJoinData <T> returnData, Expression SetTables)
        {
            var RemoveSelected = Types.GetAllTypes(SetTables);
            var Newlist        = RemoveColums(returnData.SelectedColumns, Types.JoinBaseGenerator(RemoveSelected));

            returnData.SelectedColumns = Newlist;
            returnData.SqlQuery        = Types.JoinSqlGenerator <T1>(returnData.SelectedColumns);
            return(returnData);
        }
Пример #6
0
        public static COASqlEqualData <T, T1, T2, T3, T4> Equal <T, T1, T2, T3, T4>(this COASqlJoinData <T, T1, T2, T3, T4> data, Expression <Func <T1, T2, T3, T4, bool> > equal)
        {
            data.JoinQuery = JoinEqualGenerator(equal, data.JoinType);
            foreach (var item in data.JoinQuery)
            {
                data.SqlQuery += item;
            }
            var equaldata = new COASqlEqualData <T, T1, T2, T3, T4>();

            equaldata.Add(data);
            return(equaldata);
        }
Пример #7
0
 public void Add(COASqlJoinData <T> a)
 {
     this.JoinQuery       = a.JoinQuery;
     this.SqlQuery        = a.SqlQuery;
     this.Lenght          = a.SqlQuery.Length;
     this.DataBaseType    = a.DataBaseType;
     this.OrderQuery      = a.OrderQuery;
     this.PrimaryKeyName  = a.PrimaryKeyName;
     this.SelectedColumns = a.SelectedColumns;
     this.TableName       = a.TableName;
     this.WhereQuery      = a.WhereQuery;
     joinType             = a.JoinType;
 }
Пример #8
0
 public static COASqlJoinData <T, T1, T2, T3, T4, T5, T6, T7, T8> RemoveColums <T, T1, T2, T3, T4, T5, T6, T7, T8>(this COASqlJoinData <T, T1, T2, T3, T4, T5, T6, T7, T8> data, Expression <Func <T1, T2, T3, T4, T5, T6, T7, T8, object[]> > removecolumn)
 {
     data.Add(MainRemoveGeneator <T, T1>(data, removecolumn));
     return(data);
 }
Пример #9
0
 public static COASqlJoinData <T, T1, T2> RemoveColums <T, T1, T2>(this COASqlJoinData <T, T1, T2> data, Expression <Func <T1, T2, bool[]> > removecolumn)
 {
     data.Add(MainRemoveGeneator <T, T1>(data, removecolumn));
     return(data);
 }