Ejemplo n.º 1
0
        internal RealmValue(PrimitiveValue primitive, Realm realm = null, ObjectHandle handle = default, IntPtr propertyIndex = default) : this()
        {
            Type           = primitive.Type;
            _objectHandle  = handle;
            _propertyIndex = propertyIndex;

            switch (Type)
            {
            case RealmValueType.Data:
                _dataValue = primitive.AsBinary();
                break;

            case RealmValueType.String:
                _stringValue = primitive.AsString();
                break;

            case RealmValueType.Object:
                Argument.NotNull(realm, nameof(realm));
                _objectValue = primitive.AsObject(realm);
                break;

            default:
                _primitiveValue = primitive;
                break;
            }
        }
Ejemplo n.º 2
0
 private static RealmValue Object(RealmObjectBase value) => new RealmValue(value);
Ejemplo n.º 3
0
 internal RealmValue(RealmObjectBase obj) : this()
 {
     Type         = obj == null ? RealmValueType.Null : RealmValueType.Object;
     _objectValue = obj;
 }