/// <summary> /// From BSON /// </summary> public static LogRecord FromBson(BsonDocument doc) { var record = new LogRecord(); record.Command = CommandRecord.FromBson(doc); record.Events = EventRecordCollection.FromBson(doc.GetBsonArray("Events")); record._errors = record.Command.Handlers.Errors + record.Events.Errors; return(record); }
public static CommandRecord FromBson(BsonDocument doc) { var commandDocument = doc.GetBsonDocument("Command"); var record = new CommandRecord { CommandDocument = commandDocument, Metadata = commandDocument.GetBsonDocument("Metadata").CreateCommandMetadata(), Handlers = CommandHandlerRecordCollection.FromBson(doc.GetBsonArray("Handlers")) }; return(record); }