Beispiel #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;
            }
        }
 private static RealmValue Object(RealmObjectBase value) => new RealmValue(value);
 internal RealmValue(RealmObjectBase obj) : this()
 {
     Type         = obj == null ? RealmValueType.Null : RealmValueType.Object;
     _objectValue = obj;
 }