zoukankan      html  css  js  c++  java
  • Json Ignore

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Serialization;

    namespace demo
    {
        public class DynamicJsonContractResolver: DefaultContractResolver
        {
            private readonly string[] _props;

            public DynamicJsonContractResolver(params string[] prop)
            {
                this._props = prop;
            }

            protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
            {
                return base.CreateProperties(type, memberSerialization).Where(p => !this._props.Contains(p.PropertyName)).ToList();
            }
        }
    }
  • 相关阅读:
    数据库生成说明
    Android 的 SurfaceView 双缓冲应用
    一些and知识 和ui
    weibo11
    android总结
    weibo14
    weibo9
    weibo12
    weibo10
    在线人数的统计
  • 原文地址:https://www.cnblogs.com/kevin1988/p/15176302.html
Copyright © 2011-2022 走看看