Exemple #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);
        }
Exemple #2
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);
        }