Setting IgnoreSerializableAttribute Globally in Json.net

前端 未结 4 2068
萌比男神i
萌比男神i 2020-12-10 04:07

I\'m working on a ASP.NET WebApi (Release Candidate) project where I\'m consuming several DTOs that are marked with the [Serializable] attribute. These DTOs are outside of m

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-10 04:24

    Friends, don't declare properties like this:

    public String DiscretionCode { get; set; } 
    

    But, create auxiliar vars, like old....

    private String discretionCode;
    
    public String DiscretionCode 
    { 
        get { return discretionCode;}
        set { discretionCode = value; }
    }
    

提交回复
热议问题