1
我想知道是否可以有条件地排除列表中的项目使用ShouldSerialize*
模式进行序列化。例如采取两类:列表项的条件XML序列化
public class Product{
public int ID {get; set;}
public List<Styles> ProductSyles {get; set;}
}
public class Styles{
public int ID {get; set;}
public bool Selected {get; set;}
public string StyleName {get; set;}
}
我可以去只有.Selected = true
序列化的ProductStyles
属性中的项目?这是否可以使用ShouldSerialize*
模式
使列表成为私人的,然后创建一个公共属性过滤返回结果之前的列表。 – jdweng