diff --git a/SweetBunsContracts/SweetBunsContracts/Exceptions/ValidationException.cs b/SweetBunsContracts/SweetBunsContracts/Exceptions/ValidationException.cs new file mode 100644 index 0000000..3cf6586 --- /dev/null +++ b/SweetBunsContracts/SweetBunsContracts/Exceptions/ValidationException.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SweetBunsContracts.Exceptions; + +public class ValidationException(string message) : Exception(message) +{ +} diff --git a/SweetBunsContracts/SweetBunsContracts/Extensions/StringExtensions.cs b/SweetBunsContracts/SweetBunsContracts/Extensions/StringExtensions.cs new file mode 100644 index 0000000..c85e644 --- /dev/null +++ b/SweetBunsContracts/SweetBunsContracts/Extensions/StringExtensions.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SweetBunsContracts.Extensions; + +public static class StringExtensions +{ + public static bool IsEmpty(this string str) + { + return string.IsNullOrWhiteSpace(str); + } + + public static bool IsGuid(this string str) + { + return Guid.TryParse(str, out _); + } +} diff --git a/SweetBunsContracts/SweetBunsContracts/Infrastructure/IValidation.cs b/SweetBunsContracts/SweetBunsContracts/Infrastructure/IValidation.cs new file mode 100644 index 0000000..6472385 --- /dev/null +++ b/SweetBunsContracts/SweetBunsContracts/Infrastructure/IValidation.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SweetBunsContracts.Infrastructure; +public class IValidation +{ + void Validate(); +} diff --git a/SweetBunsContracts/SweetBunsContracts/SweetBunsContracts.csproj b/SweetBunsContracts/SweetBunsContracts/SweetBunsContracts.csproj index fa71b7a..9339af7 100644 --- a/SweetBunsContracts/SweetBunsContracts/SweetBunsContracts.csproj +++ b/SweetBunsContracts/SweetBunsContracts/SweetBunsContracts.csproj @@ -6,4 +6,8 @@ enable + + + +