public AggregateSnapshot Deserialize(BsonDocument bsonDocument)
{
return new AggregateSnapshot()
{
AggregateId = bsonDocument[AggregateIdElement].AsString,
AggregateType = bsonDocument[AggregateTypeElement].AsType(),
Version = bsonDocument[VersionElement].AsInt32,
Timestamp = bsonDocument[TimestampElement].ToUniversalTime(),
State = _dataSerializer.Deserialize(bsonDocument[StateElement].AsBsonDocument, bsonDocument[StateTypeElement].AsType())
};
}
}