public static IFluentContinuation <TViewModel, TPropertyValue> BetweenValues <TViewModel, TPropertyValue>( this IFluentOperator <TViewModel, TPropertyValue> instance, object @from, object to) where TViewModel : ViewModelBase { var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance; implementerInstance.EnsureContextCurrentPropertyIsNotNull(); // uses parenthesis to satisfy syntax : IsNot.BetweenValues (...) implementerInstance.AddToken(ExpressionNode.OpenParenthesis()); implementerInstance.AddToken(ExpressionNode.OpenParenthesis()); implementerInstance.AddToken(ExpressionNode.GreaterThanValue(implementerInstance.Context.CurrentProperty, @from)); implementerInstance.AddToken(ExpressionNode.Or()); implementerInstance.AddToken(ExpressionNode.EqualToValue(implementerInstance.Context.CurrentProperty, @from)); implementerInstance.AddToken(ExpressionNode.CloseParenthesis()); implementerInstance.AddToken(ExpressionNode.And()); implementerInstance.AddToken(ExpressionNode.OpenParenthesis()); implementerInstance.AddToken(ExpressionNode.LessThanValue(implementerInstance.Context.CurrentProperty, to)); implementerInstance.AddToken(ExpressionNode.Or()); implementerInstance.AddToken(ExpressionNode.EqualToValue(implementerInstance.Context.CurrentProperty, to)); implementerInstance.AddToken(ExpressionNode.CloseParenthesis()); implementerInstance.AddToken(ExpressionNode.CloseParenthesis()); return((IFluentContinuation <TViewModel, TPropertyValue>)instance); }
public static IFluentContinuation <TViewModel, TPropertyValue> LessThan <TViewModel, TPropertyValue>( this IFluentOperator <TViewModel, TPropertyValue> instance, TPropertyValue value) where TViewModel : ViewModelBase where TPropertyValue : IComparable { var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance; implementerInstance.EnsureContextCurrentPropertyIsNotNull(); implementerInstance.AddToken(ExpressionNode.LessThanValue(implementerInstance.Context.CurrentProperty, value)); return((IFluentContinuation <TViewModel, TPropertyValue>)instance); }