My first class :
public class Person
{
public string name{get; set;}
public int Id{get; set;}
public list<Company> companies {get; set;}
}
I want to list of companies the person been.
Company Class:
public class Company
{
public string name{get; set;}
public string address{get; set; }
}
In Controller I am assigning the list:
List<Person> personList = new List<Person>();
I am returning this personlist to the view.
How can I create list of user defined type within a user defined class and How can I show A person multiple companies?