Пример #1
0
        private string CompileWheres(StatementBase statement)
        {
            StringBuilder wheres = new StringBuilder();

            wheres.Append(string.Join(" AND ", statement.Wheres.Select(x => $"[{x.ColumnName}] {x.Operand} '{x.Value}'")));

            return(wheres.ToString());
        }
Пример #2
0
        public Query <T> Select(params Expression <Func <T, object> >[] columns)
        {
            SelectStatement select = new SelectStatement
            {
                Columns = columns.GetMemberName()
            };

            CurrentMethod = select;

            return(this);
        }
Пример #3
0
        public Query <T> Insert(object data)
        {
            var insert = new InsertStatement();

            var props = data.GetType().GetRuntimeProperties();

            foreach (var prop in props)
            {
                insert.Values.Add(prop.Name, prop.GetValue(data));
            }

            CurrentMethod = insert;

            return(this);
        }
Пример #4
0
        public Query <T> Select()
        {
            CurrentMethod = new SelectStatement();

            return(this);
        }