Add new attributes
This commit is contained in:
parent
b692336c07
commit
ad3c449b1b
13
Validation/StandardDescriptionAttribute.cs
Normal file
13
Validation/StandardDescriptionAttribute.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Numerics;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace NejCommon.Validation;
|
||||||
|
|
||||||
|
public class StandardDescriptionAttribute : RegexAttribute{
|
||||||
|
public StandardDescriptionAttribute() : base(@"^[\p{L}\p{N}\p{P}\s]*$","Brown fox's - jumping over lazy dogs.", "Only normal characters are allowed, no emjos, etc."){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
13
Validation/StandardTextAttribute.cs
Normal file
13
Validation/StandardTextAttribute.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Numerics;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace NejCommon.Validation;
|
||||||
|
|
||||||
|
public class StandardTextAttribute : RegexAttribute{
|
||||||
|
public StandardTextAttribute() : base("^[a-zA-Z0-9_-]*$","Aa_bb-123"){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user