我是.Net的新手。我有两个对象,Customer
和Country
在我的项目:通过组合两个列表创建列表
public class Customer
{
public int CustomerId {get;set;}
public string CustomerName {get;set}
public String Street {get;set}
public String Address {get;set}
public int CountryId {get;set}
//...o
}
public class Country
{
public int CountryId {get;set;}
public String CountryName{get;set}
}
我有两个列表,List<Customer>
和List<Country>.
我使用的是SQL JOIN声明,列出客户的国家。但我很困惑,如何创建一个包含客户和国名的单子列表。
是否有必要为此创建单独的类?
在此先感谢。