FromBson() public static méthode

From BSON
public static FromBson ( BsonDocument doc ) : LogRecord
doc BsonDocument
Résultat LogRecord
Exemple #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);
        }
Exemple #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));
        }