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();
}
}
}