Files
NetAdmin/src/backend/NetAdmin/NetAdmin.Domain/Attributes/DataValidation/MobileAttribute.cs
nsnail 27aafacd54 Tk (#197)
* refactor: ♻️ 业务代码项目文件名与框架代码项目文件名区分

* refactor: ♻️ 业务代码项目文件名与框架代码项目文件名区分

---------

Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-11-12 18:44:13 +08:00

18 lines
581 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);
}
}