public static IExpressionBuilder <TEntity, TProperty> IsNotNull <TEntity, TProperty>(this IExpressionBuilder <TEntity, TProperty> ruleBuilder)
 {
     return(ruleBuilder.Expression(t => t != null).Message("%member% cannot be Null"));
 }
Ejemplo n.º 2
0
 public static IExpressionBuilder <TEntity, int?> HasValue <TEntity>(this IExpressionBuilder <TEntity, int?> ruleBuilder)
 {
     return(ruleBuilder.Expression(t => t != null).Message("%member% cannot be Null"));
 }
Ejemplo n.º 3
0
 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)));
 }
Ejemplo n.º 4
0
 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)));
 }
Ejemplo n.º 5
0
 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)));
 }