aboutsummaryrefslogtreecommitdiffstats
path: root/src/IOL.Helpers/Validators.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2021-11-20 21:31:30 +0100
committerivarlovlie <git@ivarlovlie.no>2021-11-20 21:31:30 +0100
commit7ff7f3902e5bdcc33bfc07fa6ad71a5798d7f8d6 (patch)
tree6e7eaaed636558c4feb88f2bb18bbb7d4c0c87be /src/IOL.Helpers/Validators.cs
parent4e41b1f31a7309b299398fd9dd53d499204fa6cf (diff)
downloaddotnet-helpers-7ff7f3902e5bdcc33bfc07fa6ad71a5798d7f8d6.tar.xz
dotnet-helpers-7ff7f3902e5bdcc33bfc07fa6ad71a5798d7f8d6.zip
Change to file-scoped namespaces.
Add ConditionalWhere to QueryableHelpers.cs
Diffstat (limited to 'src/IOL.Helpers/Validators.cs')
-rw-r--r--src/IOL.Helpers/Validators.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/IOL.Helpers/Validators.cs b/src/IOL.Helpers/Validators.cs
index d60afcf..a6937d6 100644
--- a/src/IOL.Helpers/Validators.cs
+++ b/src/IOL.Helpers/Validators.cs
@@ -1,18 +1,17 @@
using System.Net.Mail;
using System.Text.RegularExpressions;
-namespace IOL.Helpers
+namespace IOL.Helpers;
+
+public static class Validators
{
- public static class Validators
- {
- private static readonly Regex _norwegianPhoneNumber = new(@"^(0047|\+47|47)?[2-9]\d{7}$");
+ private static readonly Regex _norwegianPhoneNumber = new(@"^(0047|\+47|47)?[2-9]\d{7}$");
- public static bool IsValidEmailAddress(this string value) {
- return MailAddress.TryCreate(value, out _);
- }
+ public static bool IsValidEmailAddress(this string value) {
+ return MailAddress.TryCreate(value, out _);
+ }
- public static bool IsValidNorwegianPhoneNumber(this string value) {
- return _norwegianPhoneNumber.IsMatch(value);
- }
+ public static bool IsValidNorwegianPhoneNumber(this string value) {
+ return _norwegianPhoneNumber.IsMatch(value);
}
-} \ No newline at end of file
+}