示例#1
0
 private static Func <T, ValidationResult> Validate <T>(Func <T, bool> validator, string errorMessage)
 => (value) => validator(value) ? ValidationResult.OK() : ValidationResult.Error(errorMessage);
示例#2
0
 private static Func <T, ValidationResult> AlwaysValid <T>()
 => (value) => ValidationResult.OK();