Files
yavsc/Yavsc.Server/Attributes/Validation/YaRegularExpression.cs
2018-03-26 19:27:29 +02:00

17 lines
515 B
C#

using System.Resources;
using Yavsc.Resources;
namespace Yavsc.Attributes.Validation
{
public class YaRegularExpression : System.ComponentModel.DataAnnotations.RegularExpressionAttribute {
public YaRegularExpression(string pattern): base (pattern)
{
this.ErrorMessage = pattern;
}
public override string FormatErrorMessage(string name)
{
return ResourcesHelpers.DefaultResourceManager.GetString(this.ErrorMessageResourceName);
}
}
}