private object CreateAndPopulateDictionary(JsonReader reader, JsonDictionaryContract contract, string id) { object dictionary; if (contract.DefaultCreator != null && (!contract.DefaultCreatorNonPublic || Serializer.ConstructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor)) dictionary = contract.DefaultCreator(); else throw new JsonSerializationException("Unable to find a default constructor to use for type {0}.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)); IWrappedDictionary dictionaryWrapper = contract.CreateWrapper(dictionary); PopulateDictionary(dictionaryWrapper, reader, contract, id); return dictionaryWrapper.UnderlyingDictionary; }