MicroLite.Builder.RawWhereBuilder.ApplyTo C# (CSharp) Method

ApplyTo() public method

Applies the predicate defined in this predicate builder to the result of SqlBuilder.Select().From().
thrown if selectFrom is null.
public ApplyTo ( IWhereOrOrderBy selectFrom ) : IAndOrOrderBy
selectFrom IWhereOrOrderBy The result of the select from method call.
return IAndOrOrderBy
        public IAndOrOrderBy ApplyTo(IWhereOrOrderBy selectFrom)
        {
            if (selectFrom == null)
            {
                throw new ArgumentNullException("selectFrom");
            }

            var where = selectFrom.Where(this.builder.ToString(), this.arguments.ToArray());

            return where;
        }

Usage Example

        public void ApplyToThrowsArgumentNullExceptionForNullSqlBuilder()
        {
            var rawWhereBuilder = new RawWhereBuilder();

            var exception = Assert.Throws<ArgumentNullException>(() => rawWhereBuilder.ApplyTo(null));

            Assert.Equal("selectFrom", exception.ParamName);
        }
All Usage Examples Of MicroLite.Builder.RawWhereBuilder::ApplyTo