CQRSalad.EventStore.MongoDB.BsonExtensions.AsType C# (CSharp) Method

AsType() public static method

public static AsType ( this bsonValue ) : Type
bsonValue this
return System.Type
        public static Type AsType(this BsonValue bsonValue)
        {
            string typeName = bsonValue.AsString;
            Type type = Type.GetType(typeName);
            if (type == null)
            {
                throw new SerializationException($"Cannot load type: {typeName}. Make sure that assembly containing this type is referenced by your project.");
            }
            return type;
        }
    }
BsonExtensions