NucuCar/NucuCar.Domain/Guard.cs

24 lines
712 B
C#
Raw Normal View History

using System;
using Microsoft.Extensions.Logging;
namespace NucuCar.Domain
{
public static class Guard
{
internal static void ArgumentNotNullOrWhiteSpace(string argumentName, string argument)
{
if (string.IsNullOrWhiteSpace(argument))
{
throw new ArgumentNullException($"The argument {argumentName} is null or whitespace!");
}
}
public static void ArgumentNotNull(string argumentName, object argument)
{
if (argument == null)
{
throw new ArgumentNullException($"The argument {argumentName} is null or whitespace!");
}
}
}
}