private JsonContract CreateContract(Type objectType)
{
if (JsonConvert.IsJsonPrimitiveType(objectType))
{
return CreatePrimitiveContract(objectType);
}
if (JsonTypeReflector.GetJsonObjectAttribute(objectType) != null)
{
return CreateObjectContract(objectType);
}
if (objectType.IsSubclassOf(typeof(JToken)))
{
return CreateLinqContract(objectType);
}
if (CollectionUtils.IsDictionaryType(objectType))
{
return CreateDictionaryContract(objectType);
}
if (typeof(IEnumerable).IsAssignableFrom(objectType))
{
return CreateArrayContract(objectType);
}
return CreateObjectContract(objectType);
}