67
1
using System;
2
3
public class Program
4
{
5
6
public class Product
7
{
8
public string ProductCode { get;set;}
9
public string ProductName { get;set;}
10
public string ProductDescription { get;set;}
11
public int ProductPrice { get;set;}
12
13
public Product(string Code, string Name, string Description, int Price)
14
{
15
if(String.IsNullOrWhiteSpace(Code))
16
throw new ArgumentNullException("Product Code cannot be empty");
17
else
18
this.ProductCode =Code;
19
20
if(String.IsNullOrWhiteSpace(Name))
21
throw new ArgumentNullException("Product Name cannot be empty");
22
else
23
this.ProductName= Name;
24
Cached Result