MongoDB.Bson.Serialization.Serializers.InterfaceSerializer.Deserialize C# (CSharp) Метод

Deserialize() публичный Метод

Deserializes a document from a BsonReader.
public Deserialize ( MongoDB.Bson.IO.BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options ) : object
bsonReader MongoDB.Bson.IO.BsonReader The BsonReader.
nominalType System.Type The nominal type of the document.
options IBsonSerializationOptions The serialization options.
Результат object
        public override object Deserialize(
            BsonReader bsonReader,
            Type nominalType,
            IBsonSerializationOptions options)
        {
            if (!nominalType.IsInterface)
            {
                var message = string.Format("Nominal type must be an interface, not {0}.", nominalType.FullName);
                throw new ArgumentException(message, "nominalType");
            }

            var discriminatorConvention = BsonSerializer.LookupDiscriminatorConvention(nominalType);
            var actualType = discriminatorConvention.GetActualType(bsonReader, nominalType);
            return Deserialize(bsonReader, nominalType, actualType, options);
        }

Same methods

InterfaceSerializer::Deserialize ( MongoDB.Bson.IO.BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options ) : object