Exemplo n.º 1
0
        public TT Read <TT>(long rowID, ReadContext readContext)
        {
            if (!_isStorageInitialized)
            {
                InitializeStorage();
            }

            return((TT)_fieldSerializer.Read(rowID, readContext));
        }
Exemplo n.º 2
0
        public static void FromBsonValue(this BsonValue bsonValue, string fieldName, IContentElement contentItem, IContentSchema schema)
        {
            if (bsonValue == BsonNull.Value)
            {
                return;
            }

            if (contentItem.Fields.TryGetValue(fieldName, out ContentField? contentField))
            {
                if (schema.Fields.TryGetValue(fieldName, out ContentSchemaField? schemaField))
                {
                    IFieldSerializer fieldSerializer = MongoFieldManager.Default.GetByType(contentField.GetType());

                    fieldSerializer.Read(schemaField, contentField, bsonValue);
                }
            }
        }