public static void DateOnly( DateTime arg, [InvokerParameterName] string argName) { if (arg.TimeOfDay > TimeSpan.Zero) { throw DateTimeCodeExceptions.ArgumentWithTime(argName, arg); } }
public static void IsUtcAndDateOnly( DateTimeOffset arg, [NotNull, InvokerParameterName] string argName) { if (!arg.IsUtc()) { throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg); } if (arg.TimeOfDay > TimeSpan.Zero) { throw DateTimeCodeExceptions.ArgumentWithTime(argName, arg); } }