Beispiel #1
0
        private GetBuilder <T> InternalJoin <TJoin>(string join, Expression expression) where TJoin : IModel
        {
            if (__join.IsNull())
            {
                __join = new STR();
            }
            __join.AppendFormat(" {0} {1} ON {2} ",
                                join, database.GetTableName <TJoin>(),
                                new JoinBuilder(context).Append(expression).ToString());

            return(this);
        }
Beispiel #2
0
        private GetBuilder <T> Select(string columnName)
        {
            if (__select.IsNull() || __select[0] == '*')
            {
                __select = new STR();
            }
            if (!__select.IsEmpty)
            {
                __select.Append(", ");
            }
            __select.Append(columnName);

            return(this);
        }
Beispiel #3
0
        private GetBuilder <T> OrderBy(bool desc, string orderby)
        {
            if (__orderby.IsNull())
            {
                __orderby = new STR();
            }
            if (string.IsNullOrEmpty(orderby))
            {
                return(this);
            }

            if (!__orderby.IsEmpty)
            {
                __orderby.Append(", ");
            }
            __orderby.Append(orderby);
            if (desc)
            {
                __orderby.Append(" DESC ");
            }

            return(this);
        }