Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract C# (CSharp) Méthode

CreateObjectContract() protected méthode

Creates a JsonObjectContract for the given type.
protected CreateObjectContract ( Type objectType ) : JsonObjectContract
objectType System.Type Type of the object.
Résultat JsonObjectContract
    protected virtual JsonObjectContract CreateObjectContract(Type objectType)
    {
      JsonObjectContract contract = new JsonObjectContract(objectType);
      InitializeContract(contract);

      contract.MemberSerialization = JsonTypeReflector.GetObjectMemberSerialization(objectType);
      contract.Properties.AddRange(CreateProperties(contract));
      if (contract.DefaultCreator == null || contract.DefaultCreatorNonPublic)
        contract.ParametrizedConstructor = GetParametrizedConstructor(objectType);

      return contract;
    }