How to mark a property as non serializable for json?

前端 未结 3 1830
悲哀的现实
悲哀的现实 2021-02-07 07:44

As the title says, I want to mark a property as non serializable by the JavascriptSerializer. How can achive that ? Thanks in advance.

3条回答
  •  爱一瞬间的悲伤
    2021-02-07 08:01

    If you are needing this for ASP.NET Core or even before that, you should be using:

    [JsonIgnore]
    

    you'll need to reference:

    using Newtonsoft.Json;
    

提交回复
热议问题