Beispiel #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());
        }
Beispiel #2
0
        public Query <T> Select(params Expression <Func <T, object> >[] columns)
        {
            SelectStatement select = new SelectStatement
            {
                Columns = columns.GetMemberName()
            };

            CurrentMethod = select;

            return(this);
        }
Beispiel #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);
        }
Beispiel #4
0
        public Query <T> Select()
        {
            CurrentMethod = new SelectStatement();

            return(this);
        }