コード例 #1
0
 public static void DateOnly(
     DateTime arg,
     [InvokerParameterName] string argName)
 {
     if (arg.TimeOfDay > TimeSpan.Zero)
     {
         throw DateTimeCodeExceptions.ArgumentWithTime(argName, arg);
     }
 }
コード例 #2
0
 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);
     }
 }