日期:2014-05-17 浏览次数:21069 次
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { List<Customer> custormerList = new List<Customer>(); custormerList.Add(new Customer { CustomerID = 1, CustomerName = "张三" }); custormerList.Add(new Customer { CustomerID = 2, CustomerName = "李四" }); Customer c1 = new Customer { CustomerID = 1, CustomerName = "张三" }; Customer c2 = new Customer { CustomerID = 1, CustomerName = "张四" }; Customer[] custormerArr = new Customer[] { c1, c2 }; } } public class Customer { public int CustomerID { get; set; } public string CustomerName { get; set; } } }