如何:填写属性类型集合? [英] How to: Fill a property type Collection?
本文介绍了如何:填写属性类型集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public class 订单
{
public string orderNumber {获得跨度>; set ; }
public DateTime orderDate { get ; set ; }
private DateTime RequiredDate { get ; set ; }
private DateTime ShippedDate { get ; set ; }
public int CustomerNumber { get 跨度>; set ; }
public bool status { get 跨度>; set ; }
public string 条评论{ get 跨度>; set ; }
private IEnumerable< orderdetail>订单详情;
public virtual IEnumerable< orderdetail> OrderDetails
{
get { return OrderDetail; }
set {OrderDetail = value ; }
}
public 订单()
{
OrderDetail = 新列表< orderdetail> ();
}
}
如果是这样,我该如何填写?有没有人有任何例子?
解决方案
看看这里:演练:创建自己的集合类 [ ^ ]并按原样更改代码。
Hello good night guys okay? I have a difficulty in creating a class to list properties. The structure would be the one below?
public class Order
{
public string orderNumber {get; set; }
public DateTime orderDate {get; set; }
private DateTime RequiredDate {get; set; }
private DateTime ShippedDate {get; set; }
public int CustomerNumber {get; set; }
public bool status {get; set; }
public string comments {get; set; }
private IEnumerable<orderdetail> OrderDetail;
public virtual IEnumerable<orderdetail> OrderDetails
{
get {return OrderDetail; }
set {OrderDetail = value; }
}
public Order ()
{
OrderDetail = new List<orderdetail> ();
}
}
If so, how do I fill it? Does anyone have any examples?
解决方案
Have a look here: Walkthrough: Creating Your Own Collection Class[^] and change the code as is provided there.
这篇关于如何:填写属性类型集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!