My first class :
public class Person
{
public string name{get; set;}
public int Id{get; set;}
public list 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 personList = new List();
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?

Jenith ThakkarRank #789 · 2.9K reputationPosted Jan 7, 2019, 11:26 PM EST
Kapil GaurRank #390 · 6.4K reputationPosted Jan 8, 2019, 4:20 AM EST
Jenith ThakkarRank #789 · 2.9K reputationPosted Jan 7, 2019, 10:27 PM EST
Munish KumarRank #3,278 · 438 reputationPosted Jan 7, 2019, 10:44 PM EST
Shoaib Ahmed150 reputationPosted Jan 7, 2019, 10:37 PM EST