Beispiel #1
0
        public static COASqlSelectData <T> OrderBy <T>(this COASqlSelectData <T> data, Expression <Func <T, object> > select)
        {
            string selectStr    = " ORDER BY ";
            var    ForeachSorgu = Types.GetAllTypes(select);

            ForeachSorgu.Ad.ForEach(row => { selectStr += row + ","; });
            selectStr       = selectStr.Remove(selectStr.Length - 1, 1);
            data.SqlQuery  += selectStr + " ASC";
            data.Lenght     = data.SqlQuery.Length;
            data.OrderQuery = selectStr + " ASC";
            return(data);
        }
Beispiel #2
0
        public COASqlSelectData <T> GenerateSelectQuery(Expression <Func <T, object> > select = null)
        {
            var    SelectList = new List <string>();
            string selectStr  = "";

            if (select != null)
            {
                var ForeachSorgu = Types.GetAllTypes(select);
                ForeachSorgu.Ad.ForEach(row =>
                {
                    selectStr += row + ",";
                    SelectList.Add(row);
                });
                selectStr = selectStr.Remove(selectStr.Length - 1, 1);
            }
            else
            {
                selectStr = "*";
            }
            var str = $"SELECT {selectStr} FROM {TableName}";

            return(new COASqlSelectData <T>()
            {
                SqlQuery = str, Lenght = str.Length, TableName = TableName, Oracle = Oracle, PrimaryKeyName = PrimaryKeyName, SelectedColumns = SelectList
            });
        }
Beispiel #3
0
        public COASqlSelectData <T> GenerateSelectQuery(Expression <Func <T, object> > select)
        {
            List <string> SelectList = new List <string>();


            string selectStr    = "";
            var    ForeachSorgu = Types.GetAllTypes(select);

            ForeachSorgu.Name.ForEach(row =>
            {
                selectStr += row + ",";
                SelectList.Add(row);
            });
            selectStr = selectStr.Remove(selectStr.Length - 1, 1);

            return(selectQuery(selectStr, SelectList));
        }