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