public ResourceSlugAttribute()
 {
     Evaluator = v => Sanitizer.IsSlug((string)v);
 }
Esempio n. 2
0
 public static IChainableConstraint <IStringConstraints> IsSlug(this IStringConstraints stringConstraints, bool ignoreEmpty = true)
 {
     return(stringConstraints.Satisfy(v => (ignoreEmpty && string.IsNullOrEmpty(v)) || Sanitizer.IsSlug(v)));
 }