Basics of Working with Multiple Classes in C#

Program.CS
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. namespace CustomerOrders  
  7. {  
  8.    class Program  
  9.    {  
  10.       static void Main(string[] args)  
  11.       {  
  12.          var sa = new StorageArea(1111, "Ujjwals Storage");  
  13.          var item = sa.FindItem(1111);  
  14.          Console.WriteLine("Returning item : \'{0}\' from warehouse \'{1}\' whose item id is: {2} ", item.itemname, sa.storageShelfName, item.itemid);  
  15.          Console.ReadKey();  
  16.       }  
  17.    }  
  18. }  
StorageArea.CS
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. namespace CustomerOrders  
  7. {  
  8.    class StorageArea  
  9.    {  
  10.       public int storageShelfId { getset; } // defining properties of storage area class  
  11.       public string storageShelfName { getset; } // defining properties of storage area class  
  12.       public StorageArea(int sid,string sname) // defining constructor  
  13.       {  
  14.          storageShelfId=sid;  
  15.          storageShelfName=sname;  
  16.       }  
  17.       public Items FindItem(int id) //method for Items Class  
  18.       {  
  19.          Items it=new Items(){ itemid=id,itemname="IPhone 5"};  
  20.          return it;  
  21.       }  
  22.    }  
  23. }  
Items.CS
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. namespace CustomerOrders  
  7. {  
  8.    class Items  
  9.    {  
  10.       public int itemid { getset; }  
  11.       public string itemname { getset; }  
  12.    }  
  13. }