All Downloads are FREE. Search and download functionalities are using the official Maven repository.

csharp.ValidateRegex.mustache Maven / Gradle / Ivy

There is a newer version: 7.6.0
Show newest version
// {{{name}}} ({{{dataType}}}) pattern
Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}});
if (!regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success)
{
    yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" });
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy