<PackageReference Include="Relativity.Server.Import.SDK" Version="2.9.2" />

ArgValidationExtensions

Extensions for method arguments validation.
using System; namespace Relativity.DataExchange { internal static class ArgValidationExtensions { public static TObject ThrowIfNull<TObject>([ValidatedNotNull] this TObject obj, string paramName) where TObject : class { if (obj == null) throw new ArgumentNullException(paramName); return obj; } public static string ThrowIfNullOrEmpty([ValidatedNotNull] this string obj, string paramName) { if (string.IsNullOrEmpty(obj)) throw new ArgumentException("Parameter should not be null or empty", paramName); return obj; } } }