FromBson() public static method

From BSON
public static FromBson ( BsonDocument doc ) : LogRecord
doc BsonDocument
return LogRecord
Esempio n. 1
0
        public List <LogRecord> BsonToRecords(List <BsonDocument> documents)
        {
            var records = new List <LogRecord>();

            foreach (var document in documents)
            {
                var record = LogRecord.FromBson(document);
                records.Add(record);
            }

            return(records);
        }
Esempio n. 2
0
        /// <summary>
        /// Load record by command ID
        /// </summary>
        public LogRecord GetRecordByCommandId(String commandId)
        {
            var recordDoc = Write.Logs.FindOneAs <BsonDocument>(Query.EQ("_id", commandId));

            return(LogRecord.FromBson(recordDoc));
        }