mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Adds initial ASP.NET Core MVC replacement for Blazor WASM
This commit is contained in:
1 parent
5409200c7a
commit
193861c9c5
56 files changed
+505
-4139
No files matched your search
+4
-4
@@ -17,8 +17,8 @@ namespace Lumina.Domain.Core.Aggregates.WrittenContentLibrary.BookLibraryAggrega
|
||||
public sealed class Isbn : ValueObject
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private static readonly Regex _isbn10Regex = new(@"^(?:ISBN(?:-10)?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[-\ ]){3})[-\ 0-9X]{13}$)[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9X]$", RegexOptions.Compiled);
|
||||
private static readonly Regex _isbn13Regex = new(@"^(?:ISBN(?:-13)?:? )?(?=[0-9]{13}$|(?=(?:[0-9]+[-\ ]){4})[-\ 0-9]{17}$)97[89][-\ ]?[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9]$", RegexOptions.Compiled);
|
||||
private static readonly Regex s_isbn10Regex = new(@"^(?:ISBN(?:-10)?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[-\ ]){3})[-\ 0-9X]{13}$)[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9X]$", RegexOptions.Compiled);
|
||||
private static readonly Regex s_isbn13Regex = new(@"^(?:ISBN(?:-13)?:? )?(?=[0-9]{13}$|(?=(?:[0-9]+[-\ ]){4})[-\ 0-9]{17}$)97[89][-\ ]?[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9]$", RegexOptions.Compiled);
|
||||
#endregion
|
||||
|
||||
#region ==================================================================== PROPERTIES =================================================================================
|
||||
@@ -83,7 +83,7 @@ public sealed class Isbn : ValueObject
|
||||
/// <returns><see langword="true"/> if the ISBN-10 is valid, <see langword="false"/> otherwise.</returns>
|
||||
public static bool IsValidIsbn10(string isbn)
|
||||
{
|
||||
if (!_isbn10Regex.IsMatch(isbn))
|
||||
if (!s_isbn10Regex.IsMatch(isbn))
|
||||
return false;
|
||||
// remove any hyphens or spaces
|
||||
isbn = isbn.Replace("-", "").Replace(" ", "").ToUpper();
|
||||
@@ -105,7 +105,7 @@ public sealed class Isbn : ValueObject
|
||||
/// <returns><see langword="true"/> if the ISBN-13 is valid, <see langword="false"/> otherwise.</returns>
|
||||
public static bool IsValidIsbn13(string isbn)
|
||||
{
|
||||
if (!_isbn13Regex.IsMatch(isbn))
|
||||
if (!s_isbn13Regex.IsMatch(isbn))
|
||||
return false;
|
||||
// remove any hyphens or spaces
|
||||
isbn = isbn.Replace("-", "").Replace(" ", "");
|
||||
|
||||
Reference in new issue
Block a user