MongoDB.Bson.Serialization.BsonClassMapSerializer.ChooseBestCreator C# (CSharp) Method

ChooseBestCreator() private method

private ChooseBestCreator ( object>.Dictionary values ) : BsonCreatorMap
values object>.Dictionary
return BsonCreatorMap
        private BsonCreatorMap ChooseBestCreator(Dictionary<string, object> values)
        {
            // there's only one selector for now, but there might be more in the future (possibly even user provided)
            var selector = new MostArgumentsCreatorSelector();
            var creatorMap = selector.SelectCreator(_classMap, values);

            if (creatorMap == null)
            {
                throw new BsonSerializationException("No matching creator found.");
            }

            return creatorMap;
        }