Mark Tabor

Mark Tabor

  • 558
  • 1.9k
  • 427.3k

How to use one class object in another class object

Nov 10 2021 4:43 AM

Hi I have two classes Employee and student , Employee class itself is having Address class in it , I want to use that address class in my Student class as well See below how to use that ,Remember My both classes are in separate projects so share complete steps how to use it 

public class Employee

{

public int id{get;set;}

public string FirstName{get;set;}

public Address EmployeeAddress{get;set;}

public class Address

{

public string Street{get;set;}

public string House{get;set;}

}

}

Student class

public class Student

{

//How to get address class properties here it is in another project with Employee Class

public int id{Get;set;}

 

}


Answers (1)