Avoid spaces in user names
[TODO] fix identity config
This commit is contained in:
@ -7,11 +7,14 @@ namespace Yavsc.Attributes.Validation
|
||||
public class YaRegularExpression : System.ComponentModel.DataAnnotations.RegularExpressionAttribute {
|
||||
public YaRegularExpression(string pattern): base (pattern)
|
||||
{
|
||||
this.ErrorMessage = pattern;
|
||||
this.ErrorMessage = "RegularExpression: "+ pattern;
|
||||
|
||||
}
|
||||
|
||||
public override string FormatErrorMessage(string name)
|
||||
{
|
||||
if (ErrorMessageResourceType==null || string.IsNullOrEmpty(ErrorMessageResourceName))
|
||||
return ErrorMessage;
|
||||
var prop = this.ErrorMessageResourceType.GetProperty(ErrorMessageResourceName);
|
||||
return (string) prop.GetValue(null, BindingFlags.Static, null, null, System.Globalization.CultureInfo.CurrentUICulture);
|
||||
|
||||
|
@ -51,7 +51,6 @@ namespace Yavsc.Attributes.Validation
|
||||
}
|
||||
public override string FormatErrorMessage(string name)
|
||||
{
|
||||
|
||||
var temp = base.FormatErrorMessage(name);
|
||||
return string.Format(temp, MinimumLength, maxLen);
|
||||
}
|
||||
|
@ -36,7 +36,9 @@ namespace Yavsc.Attributes.Validation
|
||||
public override string FormatErrorMessage(string name)
|
||||
{
|
||||
if (ErrorMessageResourceType == null) // failed :/
|
||||
{
|
||||
return base.FormatErrorMessage(name);
|
||||
}
|
||||
if (ErrorMessageResourceName == null) // re failed :/
|
||||
return base.FormatErrorMessage(name);
|
||||
|
||||
|
Reference in New Issue
Block a user