Example #1
0
 private void Initialise()
 {
     rootGroup = new WhereClauseGroup
     {
         GroupType = WhereClauseGroupType.Where
     };
     currentGroup = rootGroup;
 }
Example #2
0
 public IWhereClauseBuilder EndNesting()
 {
     if (currentGroup != null && currentGroup.Parent != null)
     {
         currentGroup = currentGroup.Parent;
     }
     return(this);
 }
Example #3
0
        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));
        }