<PackageReference Include="Newtonsoft.Json" Version="6.0.2" />

ValidationUtils

static class ValidationUtils
using System; using System.Globalization; namespace Newtonsoft.Json.Utilities { internal static class ValidationUtils { public static void ArgumentNotNullOrEmpty(string value, string parameterName) { if (value == null) throw new ArgumentNullException(parameterName); if (value.Length == 0) throw new ArgumentException("'{0}' cannot be empty.".FormatWith(CultureInfo.InvariantCulture, parameterName), parameterName); } public static void ArgumentTypeIsEnum(Type enumType, string parameterName) { ArgumentNotNull(enumType, "enumType"); if (!enumType.IsEnum()) throw new ArgumentException("Type {0} is not an Enum.".FormatWith(CultureInfo.InvariantCulture, enumType), parameterName); } public static void ArgumentNotNull(object value, string parameterName) { if (value == null) throw new ArgumentNullException(parameterName); } } }