Advertisement
social1986

Untitled

Feb 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2. public class Validator
  3. {
  4.     public static void ValidatingName(string value)
  5.     {
  6.         if (string.IsNullOrWhiteSpace(value))
  7.         {
  8.             throw new ArgumentException("Name cannot be empty");
  9.         }
  10.     }
  11.  
  12.     public static void ValidatingMoney(decimal value)
  13.     {
  14.         if (value < 0)
  15.         {
  16.             throw new ArgumentException("Money cannot be negative");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement