From ad3c449b1bc11e19d04661cc6e23fdd1a460d5b8 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Tue, 7 Oct 2025 10:59:57 +0200 Subject: [PATCH] Add new attributes --- Validation/StandardDescriptionAttribute.cs | 13 +++++++++++++ Validation/StandardTextAttribute.cs | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Validation/StandardDescriptionAttribute.cs create mode 100644 Validation/StandardTextAttribute.cs diff --git a/Validation/StandardDescriptionAttribute.cs b/Validation/StandardDescriptionAttribute.cs new file mode 100644 index 0000000..7591604 --- /dev/null +++ b/Validation/StandardDescriptionAttribute.cs @@ -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."){ + + } +} \ No newline at end of file diff --git a/Validation/StandardTextAttribute.cs b/Validation/StandardTextAttribute.cs new file mode 100644 index 0000000..152de3e --- /dev/null +++ b/Validation/StandardTextAttribute.cs @@ -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"){ + + } +} \ No newline at end of file