Deserializing such that a field is an empty list rather than null

前端 未结 2 577
天命终不由人
天命终不由人 2021-01-11 14:38

If I have a class like this:

[DataContract(Name = \"\", Namespace = \"\")]
public class MyDataObject
{
    [DataMember(Name = \"NeverNull\")]
    public ILis         


        
2条回答
  •  情话喂你
    2021-01-11 15:04

    Initialization of IListwith new int[0] will help you out! Its the solution that gives me the best results.

提交回复
热议问题