Esempio n. 1
0
 /// <summary>
 ///   Associates a member name with a validation rule.
 /// </summary>
 /// <typeparam name="TTarget"> The type of the target. </typeparam>
 /// <typeparam name="TReturn"> The type of the member. </typeparam>
 /// <param name="rule"> The rule. </param>
 /// <param name="expression"> An expression identifying the member to which the validation rule is associated. </param>
 /// <returns> A clone of the source validation rule. </returns>
 public static ValidationRule <TTarget> ForMember <TTarget, TReturn>(
     this ValidationRule <TTarget> rule,
     Expression <Func <TTarget, TReturn> > expression) =>
 rule.ForMember(MemberPath.FromExpression(expression));