mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-03 02:18:00 +08:00
18 lines
578 B
C#
18 lines
578 B
C#
namespace NetAdmin.Domain.Attributes.DataValidation;
|
|
|
|
/// <summary>
|
|
/// 手机号验证器
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter)]
|
|
public sealed class MobileAttribute : RegexAttribute
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="MobileAttribute" /> class.
|
|
/// </summary>
|
|
public MobileAttribute() //
|
|
: base(Chars.RGX_MOBILE)
|
|
{
|
|
ErrorMessageResourceName = nameof(Ln.手机号码不正确);
|
|
ErrorMessageResourceType = typeof(Ln);
|
|
}
|
|
} |