private void Initialise() { rootGroup = new WhereClauseGroup { GroupType = WhereClauseGroupType.Where }; currentGroup = rootGroup; }
public IWhereClauseBuilder EndNesting() { if (currentGroup != null && currentGroup.Parent != null) { currentGroup = currentGroup.Parent; } return(this); }
private IWhereClauseBuilder AddNestedGroupToCurrentGroup <TEntity>( Expression <Func <TEntity, bool> > expression, WhereClauseGroupType groupType, string alias = null, string tableName = null, string tableSchema = null) { ThrowIfNotInitialised(); var newGroup = new WhereClauseGroup { GroupType = groupType, Parent = currentGroup }; currentGroup.Groups.Add(newGroup); currentGroup = newGroup; return(AddConditionToCurrentGroup(expression, LogicalOperator.NotSet, alias, tableName, tableSchema)); }