MongoDB.Bson.Serialization.Options.KeyValuePairSerializationOptions.ApplyAttribute C# (CSharp) Method

ApplyAttribute() public method

Apply an attribute to these serialization options and modify the options accordingly.
public ApplyAttribute ( IBsonSerializer serializer, Attribute attribute ) : void
serializer IBsonSerializer The serializer that these serialization options are for.
attribute System.Attribute The serialization options attribute.
return void
        public override void ApplyAttribute(IBsonSerializer serializer, Attribute attribute)
        {
            EnsureNotFrozen();
            var representationAttribute = attribute as BsonRepresentationAttribute;
            if (representationAttribute != null)
            {
                _representation = representationAttribute.Representation;
            }
        }