public string ProductCode { get;set;}
public string ProductName { get;set;}
public string ProductDescription { get;set;}
public int ProductPrice { get;set;}
public Product(string Code, string Name, string Description, int Price)
if(String.IsNullOrWhiteSpace(Code))
throw new ArgumentNullException("Product Code cannot be empty");
if(String.IsNullOrWhiteSpace(Name))
throw new ArgumentNullException("Product Name cannot be empty");
if(String.IsNullOrWhiteSpace(Description))
throw new ArgumentNullException("Product Description cannot be empty");
this.ProductDescription = Description;
throw new ArgumentNullException("Product Price should be greater than 0");
this.ProductPrice= Price;
public void DisplayValues()
Console.WriteLine("Product Code - {0}", this.ProductCode);
Console.WriteLine("Product Name - {0}", this.ProductName);
Console.WriteLine("Product Description - {0}", this.ProductDescription);
Console.WriteLine("Product Price - {0}", this.ProductPrice);
public static void Main()
Console.WriteLine("With null value");
Product prod1 = new Product(null, null,null,2);
Console.WriteLine(e.Message);
Console.WriteLine("\nWithout null values");
Product prod2 = new Product("640", "Nokia 640 XL","Nokia 640 XL LTE",15000);