Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract C# (CSharp) Method

ResolveContract() public method

Resolves the contract for a given type.
public ResolveContract ( Type type ) : JsonContract
type System.Type The type to resolve a contract for.
return JsonContract
    public virtual JsonContract ResolveContract(Type type)
    {
      if (type == null)
        throw new ArgumentNullException("type");

      return _typeContractCache.Get(type);
    }

Usage Example

    public void ResolveProperties_IgnoreStatic()
    {
      var resolver = new DefaultContractResolver();
      var contract = (JsonObjectContract)resolver.ResolveContract(typeof(NumberFormatInfo));

      Assert.IsFalse(contract.Properties.Any(c => c.PropertyName == "InvariantInfo"));
    }
All Usage Examples Of Newtonsoft.Json.Serialization.DefaultContractResolver::ResolveContract