mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-03 02:18:00 +08:00
18 lines
568 B
C#
18 lines
568 B
C#
namespace NetAdmin.Domain.Attributes.DataValidation;
|
|
|
|
/// <summary>
|
|
/// 端口号验证器
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter)]
|
|
public sealed class PortAttribute : RangeAttribute
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="PortAttribute" /> class.
|
|
/// </summary>
|
|
public PortAttribute() //
|
|
: base(1, ushort.MaxValue)
|
|
{
|
|
ErrorMessageResourceName = nameof(Ln.无效端口号);
|
|
ErrorMessageResourceType = typeof(Ln);
|
|
}
|
|
} |