public static IExpressionBuilder <TEntity, TProperty> IsNotNull <TEntity, TProperty>(this IExpressionBuilder <TEntity, TProperty> ruleBuilder) { return(ruleBuilder.Expression(t => t != null).Message("%member% cannot be Null")); }
public static IExpressionBuilder <TEntity, int?> HasValue <TEntity>(this IExpressionBuilder <TEntity, int?> ruleBuilder) { return(ruleBuilder.Expression(t => t != null).Message("%member% cannot be Null")); }
public static IExpressionBuilder <TEntity, int> GreaterThan <TEntity>(this IExpressionBuilder <TEntity, int> ruleBuilder, int value) { return(ruleBuilder.Expression(i => i > value).Message(string.Format("%member% has to be greater than {0}", value))); }
public static IExpressionBuilder <TEntity, int> Equal <TEntity>(this IExpressionBuilder <TEntity, int> ruleBuilder, int value) { return(ruleBuilder.Expression(i => i == value).Message(string.Format("%member% has to be equal to {0}", value))); }
public static IExpressionBuilder <TEntity, string> MinLength <TEntity>(this IExpressionBuilder <TEntity, string> ruleBuilder, int length) { return(ruleBuilder.Expression(s => s.Length > length).Message(string.Format("%member% cannot be shorter than {0} chars", length))); }