From dff4cde52241d296556fd9d81658ac6f490b4122 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Thu, 13 Jun 2024 11:03:39 +0200
Subject: [PATCH 01/54] Using flexible-schema core branch
---
wrappers/realm-core | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wrappers/realm-core b/wrappers/realm-core
index f3d7ae5f9f..6515e99132 160000
--- a/wrappers/realm-core
+++ b/wrappers/realm-core
@@ -1 +1 @@
-Subproject commit f3d7ae5f9f31d90b327a64536bb7801cc69fd85b
+Subproject commit 6515e991328553d15b19a539c04ae7fbdd8b8adb
From 571eca834640a3c8f35d5fccb3d53994fbf3ad43 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 17 Jun 2024 11:07:55 +0200
Subject: [PATCH 02/54] Added basis
---
.../Accessors/ManagedAccessor.cs | 10 ++
Realm/Realm/Handles/ObjectHandle.cs | 113 ++++++++++++++++--
2 files changed, 112 insertions(+), 11 deletions(-)
diff --git a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
index 917b1ce86a..b6d82483f8 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
@@ -114,6 +114,16 @@ public void SetValue(string propertyName, RealmValue val)
ObjectHandle.SetValue(propertyName, Metadata, val, Realm);
}
+ public RealmValue GetValueFlexi(string propertyName)
+ {
+ return ObjectHandle.GetValue(propertyName, Metadata, Realm);
+ }
+
+ public void SetValueFlexi(string propertyName, RealmValue val)
+ {
+ ObjectHandle.SetValue(propertyName, Metadata, val, Realm);
+ }
+
///
public void SetValueUnique(string propertyName, RealmValue val)
{
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index ae8f098cd4..51ace940aa 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -46,6 +46,12 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_value", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_value(ObjectHandle handle, IntPtr propertyIndex, PrimitiveValue value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_by_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void get_by_name(ObjectHandle handle, IntPtr propertyIndex, out PrimitiveValue value, out NativeException ex);
+
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_by_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void set_by_name(ObjectHandle handle, IntPtr propertyIndex, PrimitiveValue value, out NativeException ex);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_value", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr set_collection_value(ObjectHandle handle, IntPtr propertyIndex, RealmValueType type, out NativeException ex);
@@ -144,17 +150,6 @@ public int GetObjHash()
public override void Unbind() => NativeMethods.destroy(handle);
- public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
- {
- EnsureIsOpen();
-
- var propertyIndex = metadata.GetPropertyIndex(propertyName);
- NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
- nativeException.ThrowIfNecessary();
-
- return new RealmValue(result, realm, this, propertyIndex);
- }
-
public RealmSchema GetSchema()
{
EnsureIsOpen();
@@ -176,6 +171,17 @@ public RealmSchema GetSchema()
return result!;
}
+ public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
+ {
+ EnsureIsOpen();
+
+ var propertyIndex = metadata.GetPropertyIndex(propertyName);
+ NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
+ nativeException.ThrowIfNecessary();
+
+ return new RealmValue(result, realm, this, propertyIndex);
+ }
+
public void SetValue(string propertyName, Metadata metadata, in RealmValue value, Realm realm)
{
EnsureIsOpen();
@@ -249,6 +255,91 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
nativeException.ThrowIfNecessary();
}
+ public RealmValue GetValueFlexi(string propertyName, Metadata metadata, Realm realm)
+ {
+ EnsureIsOpen();
+
+ var propertyIndex = metadata.GetPropertyIndex(propertyName);
+ NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
+ nativeException.ThrowIfNecessary();
+
+ return new RealmValue(result, realm, this, propertyIndex);
+ }
+
+ public void SetValueFlexi(string propertyName, Metadata metadata, in RealmValue value, Realm realm)
+ {
+ EnsureIsOpen();
+
+ var propertyIndex = metadata.GetPropertyIndex(propertyName);
+
+ // We need to special-handle objects because they need to be managed before we can set them.
+ if (value.Type == RealmValueType.Object)
+ {
+ switch (value.AsIRealmObject())
+ {
+ case IRealmObject realmObj when !realmObj.IsManaged:
+ realm.Add(realmObj);
+ break;
+ case IEmbeddedObject embeddedObj:
+ if (embeddedObj.IsManaged)
+ {
+ NativeMethods.get_value(this, propertyIndex, out var existingValue, out var ex);
+ ex.ThrowIfNecessary();
+ if (existingValue.TryGetObjectHandle(realm, out var existingObjectHandle) &&
+ embeddedObj.GetObjectHandle()!.ObjEquals(existingObjectHandle))
+ {
+ // We're trying to set an object to the same value - treat it as a no-op.
+ return;
+ }
+
+ throw new RealmException($"Can't link to an embedded object that is already managed. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
+ }
+
+ if (GetProperty(propertyName, metadata).Type.IsRealmValue())
+ {
+ throw new NotSupportedException($"A RealmValue cannot contain an embedded object. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
+ }
+
+ var embeddedHandle = CreateEmbeddedObjectForProperty(propertyName, metadata);
+ realm.ManageEmbedded(embeddedObj, embeddedHandle);
+ return;
+
+ // Asymmetric objects can't reach this path unless the user explicitly sets them as
+ // a RealmValue property on the object.
+ // This is because:
+ // * For plain asymmetric objects (not contained within a RealmValue), the weaver
+ // raises a compilation error since asymmetric objects can't be linked to.
+ case IAsymmetricObject:
+ throw new NotSupportedException($"Asymmetric objects cannot be linked to and cannot be contained in a RealmValue. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
+ }
+ }
+ else if (value.Type.IsCollection())
+ {
+ var collectionPtr = NativeMethods.set_collection_value(this, propertyIndex, value.Type, out var collNativeException);
+ collNativeException.ThrowIfNecessary();
+
+ switch (value.Type)
+ {
+ case RealmValueType.List:
+ CollectionHelpers.PopulateCollection(realm, new ListHandle(Root!, collectionPtr), value);
+ break;
+ case RealmValueType.Dictionary:
+ CollectionHelpers.PopulateCollection(realm, new DictionaryHandle(Root!, collectionPtr), value);
+ break;
+ default:
+ break;
+ }
+
+ return;
+ }
+
+ var (primitive, handles) = value.ToNative();
+ NativeMethods.set_value(this, propertyIndex, primitive, out var nativeException);
+ handles?.Dispose();
+ nativeException.ThrowIfNecessary();
+ }
+
+
public long AddInt64(IntPtr propertyIndex, long value)
{
EnsureIsOpen();
From 8457a1a24dd25e7f0776d4d345254ce2de9d4246 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 17 Jun 2024 12:47:03 +0200
Subject: [PATCH 03/54] Added basic implementation for testing
---
Realm/Realm/DatabaseTypes/Metadata.cs | 11 ++
Realm/Realm/Dynamic/DynamicObjectApi.cs | 96 +++++-----
Realm/Realm/Handles/ObjectHandle.cs | 228 +++++++++---------------
wrappers/src/object_cs.cpp | 22 +++
4 files changed, 171 insertions(+), 186 deletions(-)
diff --git a/Realm/Realm/DatabaseTypes/Metadata.cs b/Realm/Realm/DatabaseTypes/Metadata.cs
index 912370fdef..bc6654a5f6 100644
--- a/Realm/Realm/DatabaseTypes/Metadata.cs
+++ b/Realm/Realm/DatabaseTypes/Metadata.cs
@@ -52,5 +52,16 @@ public IntPtr GetPropertyIndex(string propertyName)
throw new MissingMemberException(Schema.Name, propertyName);
}
+
+ //TODO Should merge with the previous one
+ public IntPtr? GetPropertyIndexNullable(string propertyName)
+ {
+ if (PropertyIndices.TryGetValue(propertyName, out var result))
+ {
+ return result;
+ }
+
+ return null;
+ }
}
}
diff --git a/Realm/Realm/Dynamic/DynamicObjectApi.cs b/Realm/Realm/Dynamic/DynamicObjectApi.cs
index c523a2a473..f98026d313 100644
--- a/Realm/Realm/Dynamic/DynamicObjectApi.cs
+++ b/Realm/Realm/Dynamic/DynamicObjectApi.cs
@@ -54,29 +54,34 @@ internal DynamicObjectApi(ManagedAccessor managedAccessor)
///
public T Get(string propertyName)
{
- var property = GetProperty(propertyName);
-
- if (property.Type.IsComputed())
- {
- throw new NotSupportedException(
- $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} (backlinks collection) and can't be accessed using {nameof(Dynamic)}.{nameof(Get)}. Use {nameof(GetBacklinks)} instead.");
- }
-
- if (property.Type.IsCollection(out var collectionType))
+ if (GetProperty(propertyName) is Property property)
{
- var collectionMethodName = collectionType switch
+ if (property.Type.IsComputed())
{
- PropertyType.Array => "GetList",
- PropertyType.Set => "GetSet",
- PropertyType.Dictionary => "GetDictionary",
- _ => throw new NotSupportedException($"Invalid collection type received: {collectionType}")
- };
+ throw new NotSupportedException(
+ $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} (backlinks collection) and can't be accessed using {nameof(Dynamic)}.{nameof(Get)}. Use {nameof(GetBacklinks)} instead.");
+ }
- throw new NotSupportedException(
- $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} and can't be accessed using {nameof(Dynamic)}.{nameof(Get)}. Use {collectionMethodName} instead.");
+ if (property.Type.IsCollection(out var collectionType))
+ {
+ var collectionMethodName = collectionType switch
+ {
+ PropertyType.Array => "GetList",
+ PropertyType.Set => "GetSet",
+ PropertyType.Dictionary => "GetDictionary",
+ _ => throw new NotSupportedException($"Invalid collection type received: {collectionType}")
+ };
+
+ throw new NotSupportedException(
+ $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} and can't be accessed using {nameof(Dynamic)}.{nameof(Get)}. Use {collectionMethodName} instead.");
+ }
+
+ return _managedAccessor.GetValue(propertyName).As();
+ }
+ else
+ {
+ return _managedAccessor.GetValue(propertyName).As();
}
-
- return _managedAccessor.GetValue(propertyName).As();
}
///
@@ -87,33 +92,38 @@ public T Get(string propertyName)
/// The new value of the property.
public void Set(string propertyName, RealmValue value)
{
- var property = GetProperty(propertyName);
-
- if (property.Type.IsComputed())
+ if (GetProperty(propertyName) is Property property)
{
- throw new NotSupportedException(
- $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} (backlinks collection) and can't be set directly");
- }
+ if (property.Type.IsComputed())
+ {
+ throw new NotSupportedException(
+ $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} (backlinks collection) and can't be set directly");
+ }
- if (property.Type.IsCollection(out _))
- {
- throw new NotSupportedException(
- $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} (collection) and can't be set directly.");
- }
+ if (property.Type.IsCollection(out _))
+ {
+ throw new NotSupportedException(
+ $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} (collection) and can't be set directly.");
+ }
- if (!property.Type.IsNullable() && value.Type == RealmValueType.Null)
- {
- throw new ArgumentException($"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} which is not nullable, but the supplied value is .");
- }
+ if (!property.Type.IsNullable() && value.Type == RealmValueType.Null)
+ {
+ throw new ArgumentException($"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} which is not nullable, but the supplied value is .");
+ }
- if (!property.Type.IsRealmValue() && value.Type != RealmValueType.Null && property.Type.ToRealmValueType() != value.Type)
- {
- throw new ArgumentException($"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} but the supplied value is {value.AsAny()?.GetType().Name} ({value}).");
- }
+ if (!property.Type.IsRealmValue() && value.Type != RealmValueType.Null && property.Type.ToRealmValueType() != value.Type)
+ {
+ throw new ArgumentException($"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} but the supplied value is {value.AsAny()?.GetType().Name} ({value}).");
+ }
- if (property.IsPrimaryKey)
- {
- _managedAccessor.SetValueUnique(propertyName, value);
+ if (property.IsPrimaryKey)
+ {
+ _managedAccessor.SetValueUnique(propertyName, value);
+ }
+ else
+ {
+ _managedAccessor.SetValue(propertyName, value);
+ }
}
else
{
@@ -234,11 +244,11 @@ public IDictionary GetDictionary(string propertyName)
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private Property GetProperty(string propertyName)
+ private Property? GetProperty(string propertyName)
{
if (!_managedAccessor.ObjectSchema.TryFindProperty(propertyName, out var property))
{
- throw new MissingMemberException(_managedAccessor.ObjectSchema.Name, propertyName);
+ return null;
}
return property;
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 51ace940aa..5028e150dc 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -46,11 +46,11 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_value", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_value(ObjectHandle handle, IntPtr propertyIndex, PrimitiveValue value, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_by_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern void get_by_name(ObjectHandle handle, IntPtr propertyIndex, out PrimitiveValue value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_additional_property", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void get_additional_property(ObjectHandle handle, StringValue propertyName, out PrimitiveValue value, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_by_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_by_name(ObjectHandle handle, IntPtr propertyIndex, PrimitiveValue value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_additional_property", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void set_additional_property(ObjectHandle handle, StringValue propertyName, PrimitiveValue value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_value", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr set_collection_value(ObjectHandle handle, IntPtr propertyIndex, RealmValueType type, out NativeException ex);
@@ -175,171 +175,113 @@ public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
{
EnsureIsOpen();
- var propertyIndex = metadata.GetPropertyIndex(propertyName);
- NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
- nativeException.ThrowIfNecessary();
-
- return new RealmValue(result, realm, this, propertyIndex);
- }
-
- public void SetValue(string propertyName, Metadata metadata, in RealmValue value, Realm realm)
- {
- EnsureIsOpen();
-
- var propertyIndex = metadata.GetPropertyIndex(propertyName);
-
- // We need to special-handle objects because they need to be managed before we can set them.
- if (value.Type == RealmValueType.Object)
+ if(metadata.GetPropertyIndexNullable(propertyName) is IntPtr propertyIndex)
{
- switch (value.AsIRealmObject())
- {
- case IRealmObject realmObj when !realmObj.IsManaged:
- realm.Add(realmObj);
- break;
- case IEmbeddedObject embeddedObj:
- if (embeddedObj.IsManaged)
- {
- NativeMethods.get_value(this, propertyIndex, out var existingValue, out var ex);
- ex.ThrowIfNecessary();
- if (existingValue.TryGetObjectHandle(realm, out var existingObjectHandle) &&
- embeddedObj.GetObjectHandle()!.ObjEquals(existingObjectHandle))
- {
- // We're trying to set an object to the same value - treat it as a no-op.
- return;
- }
+ NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
+ nativeException.ThrowIfNecessary();
- throw new RealmException($"Can't link to an embedded object that is already managed. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
- }
-
- if (GetProperty(propertyName, metadata).Type.IsRealmValue())
- {
- throw new NotSupportedException($"A RealmValue cannot contain an embedded object. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
- }
-
- var embeddedHandle = CreateEmbeddedObjectForProperty(propertyName, metadata);
- realm.ManageEmbedded(embeddedObj, embeddedHandle);
- return;
-
- // Asymmetric objects can't reach this path unless the user explicitly sets them as
- // a RealmValue property on the object.
- // This is because:
- // * For plain asymmetric objects (not contained within a RealmValue), the weaver
- // raises a compilation error since asymmetric objects can't be linked to.
- case IAsymmetricObject:
- throw new NotSupportedException($"Asymmetric objects cannot be linked to and cannot be contained in a RealmValue. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
- }
+ return new RealmValue(result, realm, this, propertyIndex);
}
- else if (value.Type.IsCollection())
+ else
{
- var collectionPtr = NativeMethods.set_collection_value(this, propertyIndex, value.Type, out var collNativeException);
- collNativeException.ThrowIfNecessary();
+ using Arena arena = new();
+ var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
- switch (value.Type)
- {
- case RealmValueType.List:
- CollectionHelpers.PopulateCollection(realm, new ListHandle(Root!, collectionPtr), value);
- break;
- case RealmValueType.Dictionary:
- CollectionHelpers.PopulateCollection(realm, new DictionaryHandle(Root!, collectionPtr), value);
- break;
- default:
- break;
- }
+ NativeMethods.get_additional_property(this, propertyNameNative, out var result, out var nativeException);
+ nativeException.ThrowIfNecessary();
- return;
+ return new RealmValue(result, realm, this);
}
- var (primitive, handles) = value.ToNative();
- NativeMethods.set_value(this, propertyIndex, primitive, out var nativeException);
- handles?.Dispose();
- nativeException.ThrowIfNecessary();
}
- public RealmValue GetValueFlexi(string propertyName, Metadata metadata, Realm realm)
- {
- EnsureIsOpen();
-
- var propertyIndex = metadata.GetPropertyIndex(propertyName);
- NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
- nativeException.ThrowIfNecessary();
-
- return new RealmValue(result, realm, this, propertyIndex);
- }
-
- public void SetValueFlexi(string propertyName, Metadata metadata, in RealmValue value, Realm realm)
+ public void SetValue(string propertyName, Metadata metadata, in RealmValue value, Realm realm)
{
EnsureIsOpen();
- var propertyIndex = metadata.GetPropertyIndex(propertyName);
-
- // We need to special-handle objects because they need to be managed before we can set them.
- if (value.Type == RealmValueType.Object)
+ if (metadata.GetPropertyIndexNullable(propertyName) is IntPtr propertyIndex)
{
- switch (value.AsIRealmObject())
+ // We need to special-handle objects because they need to be managed before we can set them.
+ if (value.Type == RealmValueType.Object)
{
- case IRealmObject realmObj when !realmObj.IsManaged:
- realm.Add(realmObj);
- break;
- case IEmbeddedObject embeddedObj:
- if (embeddedObj.IsManaged)
- {
- NativeMethods.get_value(this, propertyIndex, out var existingValue, out var ex);
- ex.ThrowIfNecessary();
- if (existingValue.TryGetObjectHandle(realm, out var existingObjectHandle) &&
- embeddedObj.GetObjectHandle()!.ObjEquals(existingObjectHandle))
+ switch (value.AsIRealmObject())
+ {
+ case IRealmObject realmObj when !realmObj.IsManaged:
+ realm.Add(realmObj);
+ break;
+ case IEmbeddedObject embeddedObj:
+ if (embeddedObj.IsManaged)
{
- // We're trying to set an object to the same value - treat it as a no-op.
- return;
+ NativeMethods.get_value(this, propertyIndex, out var existingValue, out var ex);
+ ex.ThrowIfNecessary();
+ if (existingValue.TryGetObjectHandle(realm, out var existingObjectHandle) &&
+ embeddedObj.GetObjectHandle()!.ObjEquals(existingObjectHandle))
+ {
+ // We're trying to set an object to the same value - treat it as a no-op.
+ return;
+ }
+
+ throw new RealmException($"Can't link to an embedded object that is already managed. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
}
- throw new RealmException($"Can't link to an embedded object that is already managed. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
- }
-
- if (GetProperty(propertyName, metadata).Type.IsRealmValue())
- {
- throw new NotSupportedException($"A RealmValue cannot contain an embedded object. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
- }
-
- var embeddedHandle = CreateEmbeddedObjectForProperty(propertyName, metadata);
- realm.ManageEmbedded(embeddedObj, embeddedHandle);
- return;
-
- // Asymmetric objects can't reach this path unless the user explicitly sets them as
- // a RealmValue property on the object.
- // This is because:
- // * For plain asymmetric objects (not contained within a RealmValue), the weaver
- // raises a compilation error since asymmetric objects can't be linked to.
- case IAsymmetricObject:
- throw new NotSupportedException($"Asymmetric objects cannot be linked to and cannot be contained in a RealmValue. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
- }
- }
- else if (value.Type.IsCollection())
- {
- var collectionPtr = NativeMethods.set_collection_value(this, propertyIndex, value.Type, out var collNativeException);
- collNativeException.ThrowIfNecessary();
+ if (GetProperty(propertyName, metadata).Type.IsRealmValue())
+ {
+ throw new NotSupportedException($"A RealmValue cannot contain an embedded object. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
+ }
- switch (value.Type)
+ var embeddedHandle = CreateEmbeddedObjectForProperty(propertyName, metadata);
+ realm.ManageEmbedded(embeddedObj, embeddedHandle);
+ return;
+
+ // Asymmetric objects can't reach this path unless the user explicitly sets them as
+ // a RealmValue property on the object.
+ // This is because:
+ // * For plain asymmetric objects (not contained within a RealmValue), the weaver
+ // raises a compilation error since asymmetric objects can't be linked to.
+ case IAsymmetricObject:
+ throw new NotSupportedException($"Asymmetric objects cannot be linked to and cannot be contained in a RealmValue. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
+ }
+ }
+ else if (value.Type.IsCollection())
{
- case RealmValueType.List:
- CollectionHelpers.PopulateCollection(realm, new ListHandle(Root!, collectionPtr), value);
- break;
- case RealmValueType.Dictionary:
- CollectionHelpers.PopulateCollection(realm, new DictionaryHandle(Root!, collectionPtr), value);
- break;
- default:
- break;
+ var collectionPtr = NativeMethods.set_collection_value(this, propertyIndex, value.Type, out var collNativeException);
+ collNativeException.ThrowIfNecessary();
+
+ switch (value.Type)
+ {
+ case RealmValueType.List:
+ CollectionHelpers.PopulateCollection(realm, new ListHandle(Root!, collectionPtr), value);
+ break;
+ case RealmValueType.Dictionary:
+ CollectionHelpers.PopulateCollection(realm, new DictionaryHandle(Root!, collectionPtr), value);
+ break;
+ default:
+ break;
+ }
+
+ return;
}
- return;
+ var (primitive, handles) = value.ToNative();
+ NativeMethods.set_value(this, propertyIndex, primitive, out var nativeException);
+ handles?.Dispose();
+ nativeException.ThrowIfNecessary();
}
+ else
+ {
+ //TODO Probably this can be improved
+ using Arena arena = new();
+ var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
- var (primitive, handles) = value.ToNative();
- NativeMethods.set_value(this, propertyIndex, primitive, out var nativeException);
- handles?.Dispose();
- nativeException.ThrowIfNecessary();
- }
+ var (primitive, handles) = value.ToNative();
+ NativeMethods.set_additional_property(this, propertyNameNative, primitive, out var nativeException);
+ handles?.Dispose();
+ nativeException.ThrowIfNecessary();
+ }
+ }
+
public long AddInt64(IntPtr propertyIndex, long value)
{
EnsureIsOpen();
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 59db3e8a6a..b04f996215 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -128,6 +128,17 @@ extern "C" {
});
}
+ REALM_EXPORT void object_get_additional_property(const Object& object, realm_string_t proeprty_name, realm_value_t* value, NativeException::Marshallable& ex)
+ {
+ handle_errors(ex, [&]() {
+ verify_can_get(object);
+
+ auto val = object.get_obj().get_any(capi_to_std(proeprty_name));
+
+ *value = to_capi(std::move(val));
+ });
+ }
+
REALM_EXPORT void object_get_schema(const Object& object, void* managed_callback, NativeException::Marshallable& ex)
{
handle_errors(ex, [&]() {
@@ -174,6 +185,17 @@ extern "C" {
});
}
+ REALM_EXPORT void object_set_additional_property(Object& object, realm_string_t property_name, realm_value_t value, NativeException::Marshallable& ex)
+ {
+ handle_errors(ex, [&]() {
+ verify_can_set(object);
+
+ //Set_additional_prop is private at the moment
+
+ object.get_obj().set_any(capi_to_std(property_name), from_capi(value));
+ });
+ }
+
REALM_EXPORT void* object_set_collection_value(Object& object, size_t property_ndx, realm_value_type type, NativeException::Marshallable& ex)
{
return handle_errors(ex, [&]()-> void* {
From da57ca969523d2be36056e07b2a7d85cb7411836 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 17 Jun 2024 14:22:13 +0200
Subject: [PATCH 04/54] Modified source genrated
---
.../AsymmetricObjectWithAllTypes_generated.cs | 1 -
.../AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs | 1 -
.../AsymmetricObjectWithEmbeddedListObject_generated.cs | 1 -
.../AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs | 1 -
.../BasicAsymmetricObject_generated.cs | 1 -
.../Dotnet_3597_Old_generated.cs | 1 +
.../Dotnet_3597_generated.cs | 3 ++-
7 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs
index 1fa4e687e6..33b7c863d1 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs
@@ -5,7 +5,6 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using NUnit.Framework;
-using NUnit.Framework.Internal;
using Realms;
using Realms.Dynamic;
using Realms.Exceptions;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs
index 72670c36ac..bd0bdbdd69 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs
@@ -5,7 +5,6 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using NUnit.Framework;
-using NUnit.Framework.Internal;
using Realms;
using Realms.Dynamic;
using Realms.Exceptions;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs
index 1baada5cd8..ee1b1bdd4b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs
@@ -5,7 +5,6 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using NUnit.Framework;
-using NUnit.Framework.Internal;
using Realms;
using Realms.Dynamic;
using Realms.Exceptions;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs
index 42ac6f9489..66d5eaf723 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs
@@ -5,7 +5,6 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using NUnit.Framework;
-using NUnit.Framework.Internal;
using Realms;
using Realms.Dynamic;
using Realms.Exceptions;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs
index f78f33d175..d09f9f138c 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs
@@ -5,7 +5,6 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using NUnit.Framework;
-using NUnit.Framework.Internal;
using Realms;
using Realms.Dynamic;
using Realms.Exceptions;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs
index be32bf8ac4..766ed07f4f 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs
@@ -36,6 +36,7 @@ static Dotnet_3597_Old()
///
/// Defines the schema for the class.
///
+ [System.Reflection.Obfuscation]
public static Realms.Schema.ObjectSchema RealmSchema = new Realms.Schema.ObjectSchema.Builder("Dotnet_3597", ObjectSchema.ObjectType.RealmObject)
{
Realms.Schema.Property.Primitive("IntProp", Realms.RealmValueType.Int, isPrimaryKey: false, indexType: IndexType.None, isNullable: false, managedName: "IntProp"),
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs
index eca00f0a47..b92d349665 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs
@@ -36,6 +36,7 @@ static Dotnet_3597()
///
/// Defines the schema for the class.
///
+ [System.Reflection.Obfuscation]
public static Realms.Schema.ObjectSchema RealmSchema = new Realms.Schema.ObjectSchema.Builder("Dotnet_3597", ObjectSchema.ObjectType.RealmObject)
{
Realms.Schema.Property.Primitive("IntProp", Realms.RealmValueType.Int, isPrimaryKey: false, indexType: IndexType.None, isNullable: false, managedName: "IntProp"),
@@ -323,7 +324,7 @@ public int IntProp
}
}
- private string _floatProp = null!;
+ private string _floatProp = string.Empty;
public string FloatProp
{
get => _floatProp;
From 38a98003e50c1bdb251acda5033b1ca558999142 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 17 Jun 2024 15:54:39 +0200
Subject: [PATCH 05/54] Added basic test
---
.../Database/DynamicAccessTests.cs | 48 +++++++++----------
1 file changed, 23 insertions(+), 25 deletions(-)
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 2cc7017a26..3906728083 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -472,17 +472,6 @@ public void GetEmbeddedObjectProperty_WhenCastToRealmObject_Throws()
});
}
- [Test]
- public void GetProperty_WhenPropertyIsMissing_Throws()
- {
- RunTestInAllModes((realm, _) =>
- {
- var allTypesObject = realm.Write(() => realm.DynamicApi.CreateObject(nameof(AllTypesObject)));
-
- Assert.Throws(() => allTypesObject.DynamicApi.Get("idontexist"));
- });
- }
-
[Test]
public void GetProperty_WhenPropertyIsBacklinks_Throws()
{
@@ -563,20 +552,6 @@ public void SetProperty_WhenUsingConvertibleType_Succeeds()
});
}
- [Test]
- public void SetProperty_WhenPropertyIsMissing_Throws()
- {
- RunTestInAllModes((realm, _) =>
- {
- realm.Write(() =>
- {
- var ato = realm.DynamicApi.CreateObject(nameof(AllTypesObject));
-
- Assert.Throws(() => ato.DynamicApi.Set("idontexist", "foo"));
- });
- });
- }
-
[Test]
public void SetProperty_WhenPropertyIsBacklinks_Throws()
{
@@ -1003,6 +978,29 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
#endregion
+ #region Flexible schema
+
+ [Test]
+ public void FlexibleSchema_BaseTest()
+ {
+ var person = _realm.Write(() =>
+ {
+ return _realm.Add(new Person());
+ });
+
+ _realm.Write(() =>
+ {
+ person.DynamicApi.Set("prop1", "testval");
+ person.DynamicApi.Set("prop2", 10);
+
+ });
+
+ Assert.That(person.DynamicApi.Get("prop1"), Is.EqualTo("testval"));
+ Assert.That(person.DynamicApi.Get("prop2"), Is.EqualTo(10));
+ }
+
+ #endregion
+
[Test]
public void GetPrimaryKey_WhenPrivate_Works()
{
From 7695a8cc20a5e51bebd216d2791131b91f705262 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Tue, 18 Jun 2024 10:45:29 +0200
Subject: [PATCH 06/54] Basic test passing [skip-ci]
---
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 13 ++++++-------
wrappers/realm-core | 2 +-
wrappers/src/shared_realm_cs.cpp | 1 +
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 3906728083..07e6d665bf 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -983,20 +983,19 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
[Test]
public void FlexibleSchema_BaseTest()
{
- var person = _realm.Write(() =>
+ var testObj = _realm.Write(() =>
{
- return _realm.Add(new Person());
+ return _realm.Add(new IntPropertyObject());
});
_realm.Write(() =>
{
- person.DynamicApi.Set("prop1", "testval");
- person.DynamicApi.Set("prop2", 10);
-
+ testObj.DynamicApi.Set("prop1", "testval");
+ testObj.DynamicApi.Set("prop2", 10);
});
- Assert.That(person.DynamicApi.Get("prop1"), Is.EqualTo("testval"));
- Assert.That(person.DynamicApi.Get("prop2"), Is.EqualTo(10));
+ Assert.That(testObj.DynamicApi.Get("prop1"), Is.EqualTo("testval"));
+ Assert.That(testObj.DynamicApi.Get("prop2"), Is.EqualTo(10));
}
#endregion
diff --git a/wrappers/realm-core b/wrappers/realm-core
index 6515e99132..591745a304 160000
--- a/wrappers/realm-core
+++ b/wrappers/realm-core
@@ -1 +1 @@
-Subproject commit 6515e991328553d15b19a539c04ae7fbdd8b8adb
+Subproject commit 591745a304e224bb72e2c1ac5f4453dd6687d4b9
diff --git a/wrappers/src/shared_realm_cs.cpp b/wrappers/src/shared_realm_cs.cpp
index 8b1d6b9061..0d31be9985 100644
--- a/wrappers/src/shared_realm_cs.cpp
+++ b/wrappers/src/shared_realm_cs.cpp
@@ -305,6 +305,7 @@ REALM_EXPORT SharedRealm* shared_realm_open(Configuration configuration, NativeE
Realm::Config config = get_shared_realm_config(configuration);
config.in_memory = configuration.in_memory;
config.automatically_handle_backlinks_in_migrations = configuration.automatically_migrate_embedded;
+ config.flexible_schema = true;
if (configuration.read_only) {
config.schema_mode = SchemaMode::Immutable;
From 4462ec1ffcbe43f702cfb2ac5b0e344f20175020 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Tue, 18 Jun 2024 15:55:41 +0200
Subject: [PATCH 07/54] Updated core
---
wrappers/realm-core | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wrappers/realm-core b/wrappers/realm-core
index 591745a304..9ab20d928e 160000
--- a/wrappers/realm-core
+++ b/wrappers/realm-core
@@ -1 +1 @@
-Subproject commit 591745a304e224bb72e2c1ac5f4453dd6687d4b9
+Subproject commit 9ab20d928eb34d94279c95afd0e75295e4f33c00
From faa7df0098a66f59ab536a4dfd75f9cfc6861515 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Tue, 18 Jun 2024 15:55:53 +0200
Subject: [PATCH 08/54] Removed unnecessary
---
Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
index b6d82483f8..917b1ce86a 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
@@ -114,16 +114,6 @@ public void SetValue(string propertyName, RealmValue val)
ObjectHandle.SetValue(propertyName, Metadata, val, Realm);
}
- public RealmValue GetValueFlexi(string propertyName)
- {
- return ObjectHandle.GetValue(propertyName, Metadata, Realm);
- }
-
- public void SetValueFlexi(string propertyName, RealmValue val)
- {
- ObjectHandle.SetValue(propertyName, Metadata, val, Realm);
- }
-
///
public void SetValueUnique(string propertyName, RealmValue val)
{
From f532c84148968eb6b56d54be2541e7fd2addf87e Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Tue, 18 Jun 2024 15:56:21 +0200
Subject: [PATCH 09/54] Improved handling of lists and objects
---
Realm/Realm/Dynamic/DynamicObjectApi.cs | 10 +++-
Realm/Realm/Handles/ObjectHandle.cs | 40 +++++++++++++-
.../Database/DynamicAccessTests.cs | 33 +++++++++--
wrappers/src/object_cs.cpp | 55 ++++++++++++++++---
4 files changed, 121 insertions(+), 17 deletions(-)
diff --git a/Realm/Realm/Dynamic/DynamicObjectApi.cs b/Realm/Realm/Dynamic/DynamicObjectApi.cs
index f98026d313..6a0959b7d1 100644
--- a/Realm/Realm/Dynamic/DynamicObjectApi.cs
+++ b/Realm/Realm/Dynamic/DynamicObjectApi.cs
@@ -53,6 +53,12 @@ internal DynamicObjectApi(ManagedAccessor managedAccessor)
/// object, casting to is always valid.
///
public T Get(string propertyName)
+ {
+ return Get(propertyName).As();
+ }
+
+ //TODO Add docs
+ public RealmValue Get(string propertyName)
{
if (GetProperty(propertyName) is Property property)
{
@@ -76,11 +82,11 @@ public T Get(string propertyName)
$"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} and can't be accessed using {nameof(Dynamic)}.{nameof(Get)}. Use {collectionMethodName} instead.");
}
- return _managedAccessor.GetValue(propertyName).As();
+ return _managedAccessor.GetValue(propertyName);
}
else
{
- return _managedAccessor.GetValue(propertyName).As();
+ return _managedAccessor.GetValue(propertyName);
}
}
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 5028e150dc..7139b97dab 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -55,6 +55,9 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_value", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr set_collection_value(ObjectHandle handle, IntPtr propertyIndex, RealmValueType type, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_additional_property", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr set_collection_additional_property(ObjectHandle handle, StringValue propertyName, RealmValueType type, out NativeException ex);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_create_embedded", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_embedded_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
@@ -269,17 +272,50 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
}
else
{
+ //TODO Eventually merge with the previous case
+
//TODO Probably this can be improved
using Arena arena = new();
var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
+ if (value.Type == RealmValueType.Object)
+ {
+ switch (value.AsIRealmObject())
+ {
+ case IRealmObject realmObj when !realmObj.IsManaged:
+ realm.Add(realmObj);
+ break;
+ case IEmbeddedObject:
+ throw new NotSupportedException($"A RealmValue cannot contain an embedded object. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
+ case IAsymmetricObject:
+ throw new NotSupportedException($"Asymmetric objects cannot be linked to and cannot be contained in a RealmValue. Attempted to set {value} to {metadata.Schema.Name}.{propertyName}");
+ }
+ }
+ else if (value.Type.IsCollection())
+ {
+ var collectionPtr = NativeMethods.set_collection_additional_property(this, propertyNameNative, value.Type, out var collNativeException);
+ collNativeException.ThrowIfNecessary();
+
+ switch (value.Type)
+ {
+ case RealmValueType.List:
+ CollectionHelpers.PopulateCollection(realm, new ListHandle(Root!, collectionPtr), value);
+ break;
+ case RealmValueType.Dictionary:
+ CollectionHelpers.PopulateCollection(realm, new DictionaryHandle(Root!, collectionPtr), value);
+ break;
+ default:
+ break;
+ }
+
+ return;
+ }
+
var (primitive, handles) = value.ToNative();
NativeMethods.set_additional_property(this, propertyNameNative, primitive, out var nativeException);
handles?.Dispose();
nativeException.ThrowIfNecessary();
}
-
-
}
public long AddInt64(IntPtr propertyIndex, long value)
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 07e6d665bf..591a801d1a 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -17,6 +17,7 @@
////////////////////////////////////////////////////////////////////////////
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.CSharp.RuntimeBinder;
@@ -983,21 +984,41 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
[Test]
public void FlexibleSchema_BaseTest()
{
- var testObj = _realm.Write(() =>
+ var person = _realm.Write(() =>
{
- return _realm.Add(new IntPropertyObject());
+ return _realm.Add(new Person());
});
+ var testObj = new Person { FirstName = "Luigi" };
+ var testList = new List { 1, "test", true };
+
_realm.Write(() =>
{
- testObj.DynamicApi.Set("prop1", "testval");
- testObj.DynamicApi.Set("prop2", 10);
+ person.DynamicApi.Set("propString", "testval");
+ person.DynamicApi.Set("propInt", 10);
+ person.DynamicApi.Set("propObj", testObj);
+ person.DynamicApi.Set("propList", testList);
+
});
- Assert.That(testObj.DynamicApi.Get("prop1"), Is.EqualTo("testval"));
- Assert.That(testObj.DynamicApi.Get("prop2"), Is.EqualTo(10));
+ Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
+ Assert.That(person.DynamicApi.Get("propInt"), Is.EqualTo(10));
+ Assert.That(person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
+ Assert.That(person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
}
+ /** To test
+ * - add and retrieve objects
+ * - add and retrieve collections
+ * - set on same property changes
+ * - set null value
+ * - retrieve property that does not exist raises exception
+ * - retrieve additional properties
+ * - erase a property
+ *
+ *
+ */
+
#endregion
[Test]
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index b04f996215..554a8af929 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -105,7 +105,7 @@ extern "C" {
}
auto val = object.get_obj().get_any(prop.column_key);
- if (val.is_null())
+ if (val.is_null()) //TODO I think we don't need this check
{
*value = to_capi(std::move(val));
return;
@@ -128,14 +128,26 @@ extern "C" {
});
}
- REALM_EXPORT void object_get_additional_property(const Object& object, realm_string_t proeprty_name, realm_value_t* value, NativeException::Marshallable& ex)
+ REALM_EXPORT void object_get_additional_property(const Object& object, realm_string_t property_name, realm_value_t* value, NativeException::Marshallable& ex)
{
handle_errors(ex, [&]() {
verify_can_get(object);
- auto val = object.get_obj().get_any(capi_to_std(proeprty_name));
+ auto val = object.get_obj().get_additional_prop(capi_to_std(property_name));
- *value = to_capi(std::move(val));
+ Path path = { PathElement(capi_to_std(property_name)) };
+
+ switch (val.get_type()) {
+ case type_TypedLink:
+ *value = to_capi(val.get(), object.realm());
+ break;
+ case type_List:
+ *value = to_capi(new List(object.realm(), object.get_obj().get_list_ptr(path)));
+ break;
+ default:
+ *value = to_capi(std::move(val));
+ break;
+ }
});
}
@@ -190,9 +202,7 @@ extern "C" {
handle_errors(ex, [&]() {
verify_can_set(object);
- //Set_additional_prop is private at the moment
-
- object.get_obj().set_any(capi_to_std(property_name), from_capi(value));
+ object.get_obj().set_additional_prop(capi_to_std(property_name), from_capi(value));
});
}
@@ -225,6 +235,37 @@ extern "C" {
});
}
+ REALM_EXPORT void* object_set_collection_additional_property(Object& object,
+ realm_string_t property_name, realm_value_type type, NativeException::Marshallable& ex)
+ {
+ return handle_errors(ex, [&]()-> void* {
+ verify_can_set(object);
+
+ auto prop = capi_to_std(property_name);
+
+ Path path = { PathElement(prop) };
+
+ switch (type)
+ {
+ case realm::binding::realm_value_type::RLM_TYPE_LIST:
+ {
+
+ object.get_obj().set_collection(prop, CollectionType::List);
+ //TODO We probably need to ask for methods that do not require to build a path
+ auto innerList = new List(object.realm(), object.get_obj().get_list_ptr(path));
+ innerList->remove_all();
+ return innerList;
+ }
+ case realm::binding::realm_value_type::RLM_TYPE_DICTIONARY:
+ {
+ REALM_TERMINATE("Invalid collection type");
+ }
+ default:
+ REALM_TERMINATE("Invalid collection type");
+ }
+ });
+ }
+
REALM_EXPORT Results* object_get_backlinks(Object& object, size_t property_ndx, NativeException::Marshallable& ex)
{
return handle_errors(ex, [&] {
From 8d7da77a8eaef784a257059a5640524892650407 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 19 Jun 2024 14:25:47 +0200
Subject: [PATCH 10/54] Various improvements
---
.../Accessors/ManagedAccessor.cs | 12 +++++++
Realm/Realm/Dynamic/DynamicObjectApi.cs | 12 +++++++
Realm/Realm/Handles/ObjectHandle.cs | 29 ++++++++++++++-
.../Database/DynamicAccessTests.cs | 33 +++++++++++++----
wrappers/src/object_cs.cpp | 35 +++++++++++++++++--
5 files changed, 110 insertions(+), 11 deletions(-)
diff --git a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
index 917b1ce86a..80d56871a0 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
@@ -114,6 +114,18 @@ public void SetValue(string propertyName, RealmValue val)
ObjectHandle.SetValue(propertyName, Metadata, val, Realm);
}
+ //TODO Add docs
+ public void UnsetProperty(string propertyName)
+ {
+ ObjectHandle.UnsetProperty(propertyName);
+ }
+
+ //TODO Add docs / fix name
+ public IEnumerable GetAdditionalProperties()
+ {
+ return ObjectHandle.GetAdditionalProperties();
+ }
+
///
public void SetValueUnique(string propertyName, RealmValue val)
{
diff --git a/Realm/Realm/Dynamic/DynamicObjectApi.cs b/Realm/Realm/Dynamic/DynamicObjectApi.cs
index 6a0959b7d1..88ae1597a1 100644
--- a/Realm/Realm/Dynamic/DynamicObjectApi.cs
+++ b/Realm/Realm/Dynamic/DynamicObjectApi.cs
@@ -137,6 +137,18 @@ public void Set(string propertyName, RealmValue value)
}
}
+ //TODO Add docs
+ public void Unset(string propertyName)
+ {
+ _managedAccessor.UnsetProperty(propertyName);
+ }
+
+ //TODO Add docs / fix name
+ public IEnumerable GetAdditionalProperties()
+ {
+ return _managedAccessor.GetAdditionalProperties();
+ }
+
///
/// Gets the value of a backlink property. This property must have been declared
/// explicitly and annotated with .
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 7139b97dab..756eee9a99 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -17,6 +17,9 @@
////////////////////////////////////////////////////////////////////////////
using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
using System.Runtime.InteropServices;
using Realms.Exceptions;
using Realms.Extensions;
@@ -46,6 +49,9 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_value", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_value(ObjectHandle handle, IntPtr propertyIndex, PrimitiveValue value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_unset_property", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void unset_property(ObjectHandle handle, StringValue propertyName, out NativeException ex);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_additional_property", CallingConvention = CallingConvention.Cdecl)]
public static extern void get_additional_property(ObjectHandle handle, StringValue propertyName, out PrimitiveValue value, out NativeException ex);
@@ -58,6 +64,9 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_additional_property", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr set_collection_additional_property(ObjectHandle handle, StringValue propertyName, RealmValueType type, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_additional_properties", CallingConvention = CallingConvention.Cdecl)]
+ public static extern StringValue[] get_additional_properties(ObjectHandle handle, out NativeException ex);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_create_embedded", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_embedded_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
@@ -273,7 +282,6 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
else
{
//TODO Eventually merge with the previous case
-
//TODO Probably this can be improved
using Arena arena = new();
var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
@@ -318,6 +326,25 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
}
}
+ public void UnsetProperty(string propertyName)
+ {
+ using Arena arena = new();
+ var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
+
+ NativeMethods.unset_property(this, propertyNameNative, out var nativeException);
+ nativeException.ThrowIfNecessary();
+ }
+
+ public IEnumerable GetAdditionalProperties()
+ {
+ var value = NativeMethods.get_additional_properties(this, out var nativeException);
+ nativeException.ThrowIfNecessary();
+
+ //TODO We should not get empty null values here, so this is mostly to make the warning go away
+ //Need to fix this
+ return value.Select(v => v.ToDotnetString() ?? string.Empty);
+ }
+
public long AddInt64(IntPtr propertyIndex, long value)
{
EnsureIsOpen();
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 591a801d1a..df13f3c984 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -992,29 +992,48 @@ public void FlexibleSchema_BaseTest()
var testObj = new Person { FirstName = "Luigi" };
var testList = new List { 1, "test", true };
+ // Basic set/get
_realm.Write(() =>
{
person.DynamicApi.Set("propString", "testval");
person.DynamicApi.Set("propInt", 10);
person.DynamicApi.Set("propObj", testObj);
person.DynamicApi.Set("propList", testList);
-
+ person.DynamicApi.Set("propNull", RealmValue.Null);
});
Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
Assert.That(person.DynamicApi.Get("propInt"), Is.EqualTo(10));
Assert.That(person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
Assert.That(person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
+ Assert.That(person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
+
+ // Change type
+ _realm.Write(() =>
+ {
+ person.DynamicApi.Set("propString", 23);
+ });
+
+ Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo(23));
+
+ // Get unknown property
+ Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+
+ // Unset property
+ _realm.Write(() =>
+ {
+ person.DynamicApi.Unset("propString");
+ });
+ Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
+
+ // Get all additional properties keys
+ var additionalProperties = person.DynamicApi.GetAdditionalProperties();
+ Assert.That(additionalProperties, Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
}
/** To test
- * - add and retrieve objects
- * - add and retrieve collections
- * - set on same property changes
- * - set null value
- * - retrieve property that does not exist raises exception
* - retrieve additional properties
- * - erase a property
+ * - erase a property (both in additional property and not...?)
*
*
*/
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 554a8af929..6c865164ce 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -105,9 +105,9 @@ extern "C" {
}
auto val = object.get_obj().get_any(prop.column_key);
- if (val.is_null()) //TODO I think we don't need this check
+ if (val.is_null())
{
- *value = to_capi(std::move(val));
+ *value = to_capi(val);
return;
}
@@ -135,6 +135,12 @@ extern "C" {
auto val = object.get_obj().get_additional_prop(capi_to_std(property_name));
+ if (val.is_null())
+ {
+ *value = to_capi(val);
+ return;
+ }
+
Path path = { PathElement(capi_to_std(property_name)) };
switch (val.get_type()) {
@@ -201,11 +207,34 @@ extern "C" {
{
handle_errors(ex, [&]() {
verify_can_set(object);
-
object.get_obj().set_additional_prop(capi_to_std(property_name), from_capi(value));
});
}
+ REALM_EXPORT void object_unset_property(Object& object, realm_string_t property_name, NativeException::Marshallable& ex)
+ {
+ handle_errors(ex, [&]() {
+ verify_can_set(object);
+ object.get_obj().erase_prop(capi_to_std(property_name));
+ });
+ }
+
+ REALM_EXPORT realm_string_t* object_get_additional_properties(Object& object, NativeException::Marshallable& ex)
+ {
+ return handle_errors(ex, [&]() {
+ auto props = object.get_obj().get_additional_properties();
+
+ size_t size = props.size();
+ realm_string_t* realm_string_array = new realm_string_t[size];
+
+ for (size_t i = 0; i < size; ++i) {
+ realm_string_array[i] = to_capi(props[i]);
+ }
+
+ return realm_string_array;
+ });
+ }
+
REALM_EXPORT void* object_set_collection_value(Object& object, size_t property_ndx, realm_value_type type, NativeException::Marshallable& ex)
{
return handle_errors(ex, [&]()-> void* {
From 78a1a13f9654d211c8fa04764657a980e3a63948 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Thu, 20 Jun 2024 11:10:43 +0200
Subject: [PATCH 11/54] Added configuration for flexible schema
---
Realm/Realm/Configurations/RealmConfigurationBase.cs | 4 ++++
Realm/Realm/Native/Configuration.cs | 2 ++
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 7 -------
Tests/Realm.Tests/RealmInstanceTest.cs | 2 +-
wrappers/src/shared_realm_cs.cpp | 2 +-
wrappers/src/shared_realm_cs.hpp | 2 ++
6 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Realm/Realm/Configurations/RealmConfigurationBase.cs b/Realm/Realm/Configurations/RealmConfigurationBase.cs
index 5fc1de87af..34abd08699 100644
--- a/Realm/Realm/Configurations/RealmConfigurationBase.cs
+++ b/Realm/Realm/Configurations/RealmConfigurationBase.cs
@@ -89,6 +89,9 @@ public abstract class RealmConfigurationBase
///
public ShouldCompactDelegate? ShouldCompactOnLaunch { get; set; }
+ //TODO Add docs
+ public bool FlexibleSchema { get; set; }
+
internal bool EnableCache = true;
///
@@ -254,6 +257,7 @@ internal virtual Configuration CreateNativeConfiguration(Arena arena)
managed_config = GCHandle.ToIntPtr(managedConfig),
encryption_key = MarshaledVector.AllocateFrom(EncryptionKey, arena),
invoke_should_compact_callback = ShouldCompactOnLaunch != null,
+ flexible_schema = FlexibleSchema,
};
return config;
diff --git a/Realm/Realm/Native/Configuration.cs b/Realm/Realm/Native/Configuration.cs
index 13b82f5ec4..031b2bf114 100644
--- a/Realm/Realm/Native/Configuration.cs
+++ b/Realm/Realm/Native/Configuration.cs
@@ -55,5 +55,7 @@ internal struct Configuration
internal NativeBool invoke_migration_callback;
internal NativeBool automatically_migrate_embedded;
+
+ internal NativeBool flexible_schema;
}
}
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index df13f3c984..77b92f881a 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -1031,13 +1031,6 @@ public void FlexibleSchema_BaseTest()
Assert.That(additionalProperties, Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
}
- /** To test
- * - retrieve additional properties
- * - erase a property (both in additional property and not...?)
- *
- *
- */
-
#endregion
[Test]
diff --git a/Tests/Realm.Tests/RealmInstanceTest.cs b/Tests/Realm.Tests/RealmInstanceTest.cs
index cc0a5410d5..50e29c7ecf 100644
--- a/Tests/Realm.Tests/RealmInstanceTest.cs
+++ b/Tests/Realm.Tests/RealmInstanceTest.cs
@@ -31,7 +31,7 @@ public abstract class RealmInstanceTest : RealmTest
protected Realm _realm => _lazyRealm.Value;
- protected virtual RealmConfiguration CreateConfiguration(string path) => new(path);
+ protected virtual RealmConfiguration CreateConfiguration(string path) => new(path) { FlexibleSchema = true };
protected T Freeze(T obj)
where T : IRealmObjectBase
diff --git a/wrappers/src/shared_realm_cs.cpp b/wrappers/src/shared_realm_cs.cpp
index 0d31be9985..c17ccb7635 100644
--- a/wrappers/src/shared_realm_cs.cpp
+++ b/wrappers/src/shared_realm_cs.cpp
@@ -305,7 +305,7 @@ REALM_EXPORT SharedRealm* shared_realm_open(Configuration configuration, NativeE
Realm::Config config = get_shared_realm_config(configuration);
config.in_memory = configuration.in_memory;
config.automatically_handle_backlinks_in_migrations = configuration.automatically_migrate_embedded;
- config.flexible_schema = true;
+ config.flexible_schema = configuration.flexible_schema;
if (configuration.read_only) {
config.schema_mode = SchemaMode::Immutable;
diff --git a/wrappers/src/shared_realm_cs.hpp b/wrappers/src/shared_realm_cs.hpp
index 85edbb9318..6ca80da165 100644
--- a/wrappers/src/shared_realm_cs.hpp
+++ b/wrappers/src/shared_realm_cs.hpp
@@ -64,6 +64,8 @@ struct Configuration
bool invoke_migration_callback;
bool automatically_migrate_embedded;
+
+ bool flexible_schema;
};
struct SyncConfiguration
From fbc1d36bd95c732a199a696ced41a766c0861460 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Thu, 20 Jun 2024 11:12:03 +0200
Subject: [PATCH 12/54] Updated changelog
---
wrappers/realm-core | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wrappers/realm-core b/wrappers/realm-core
index 9ab20d928e..4fa42845aa 160000
--- a/wrappers/realm-core
+++ b/wrappers/realm-core
@@ -1 +1 @@
-Subproject commit 9ab20d928eb34d94279c95afd0e75295e4f33c00
+Subproject commit 4fa42845aab6c74739fb30b9f54b1f36397bd6a8
From a1eadde422b79f34eeea5269d25736748bbcc568 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Thu, 20 Jun 2024 17:41:19 +0200
Subject: [PATCH 13/54] Fixes
---
Realm/Realm/Handles/ObjectHandle.cs | 1 -
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 13 ++++++++-----
Tests/Realm.Tests/RealmInstanceTest.cs | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 756eee9a99..8b1ec2d156 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -17,7 +17,6 @@
////////////////////////////////////////////////////////////////////////////
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 77b92f881a..d103680f38 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -984,16 +984,19 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
[Test]
public void FlexibleSchema_BaseTest()
{
- var person = _realm.Write(() =>
+ _configuration.FlexibleSchema = true;
+ var realm = GetRealm(_configuration);
+
+ var person = realm.Write(() =>
{
- return _realm.Add(new Person());
+ return realm.Add(new Person());
});
var testObj = new Person { FirstName = "Luigi" };
var testList = new List { 1, "test", true };
// Basic set/get
- _realm.Write(() =>
+ realm.Write(() =>
{
person.DynamicApi.Set("propString", "testval");
person.DynamicApi.Set("propInt", 10);
@@ -1009,7 +1012,7 @@ public void FlexibleSchema_BaseTest()
Assert.That(person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
// Change type
- _realm.Write(() =>
+ realm.Write(() =>
{
person.DynamicApi.Set("propString", 23);
});
@@ -1020,7 +1023,7 @@ public void FlexibleSchema_BaseTest()
Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
// Unset property
- _realm.Write(() =>
+ realm.Write(() =>
{
person.DynamicApi.Unset("propString");
});
diff --git a/Tests/Realm.Tests/RealmInstanceTest.cs b/Tests/Realm.Tests/RealmInstanceTest.cs
index 50e29c7ecf..cc0a5410d5 100644
--- a/Tests/Realm.Tests/RealmInstanceTest.cs
+++ b/Tests/Realm.Tests/RealmInstanceTest.cs
@@ -31,7 +31,7 @@ public abstract class RealmInstanceTest : RealmTest
protected Realm _realm => _lazyRealm.Value;
- protected virtual RealmConfiguration CreateConfiguration(string path) => new(path) { FlexibleSchema = true };
+ protected virtual RealmConfiguration CreateConfiguration(string path) => new(path);
protected T Freeze(T obj)
where T : IRealmObjectBase
From 243c7823753b905e614d480802101fd645938f3d Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 24 Jun 2024 09:05:23 +0200
Subject: [PATCH 14/54] Chwnged name
---
Realm/Realm/Configurations/RealmConfigurationBase.cs | 4 ++--
Realm/Realm/Native/Configuration.cs | 2 +-
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Realm/Realm/Configurations/RealmConfigurationBase.cs b/Realm/Realm/Configurations/RealmConfigurationBase.cs
index 34abd08699..76d4a25ded 100644
--- a/Realm/Realm/Configurations/RealmConfigurationBase.cs
+++ b/Realm/Realm/Configurations/RealmConfigurationBase.cs
@@ -90,7 +90,7 @@ public abstract class RealmConfigurationBase
public ShouldCompactDelegate? ShouldCompactOnLaunch { get; set; }
//TODO Add docs
- public bool FlexibleSchema { get; set; }
+ public bool RelaxedSchema { get; set; }
internal bool EnableCache = true;
@@ -257,7 +257,7 @@ internal virtual Configuration CreateNativeConfiguration(Arena arena)
managed_config = GCHandle.ToIntPtr(managedConfig),
encryption_key = MarshaledVector.AllocateFrom(EncryptionKey, arena),
invoke_should_compact_callback = ShouldCompactOnLaunch != null,
- flexible_schema = FlexibleSchema,
+ relaxed_schema = RelaxedSchema,
};
return config;
diff --git a/Realm/Realm/Native/Configuration.cs b/Realm/Realm/Native/Configuration.cs
index 031b2bf114..25f3a311f7 100644
--- a/Realm/Realm/Native/Configuration.cs
+++ b/Realm/Realm/Native/Configuration.cs
@@ -56,6 +56,6 @@ internal struct Configuration
internal NativeBool automatically_migrate_embedded;
- internal NativeBool flexible_schema;
+ internal NativeBool relaxed_schema;
}
}
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index d103680f38..34766b3192 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -140,6 +140,7 @@ public void SetAndGetValue_NewAPI(string propertyName, object propertyValue)
});
Assert.That(allTypesObject.DynamicApi.Get(propertyName), Is.EqualTo(realmValue));
+ Assert.That(allTypesObject.DynamicApi.Get(propertyName), Is.EqualTo(realmValue));
});
}
@@ -984,7 +985,7 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
[Test]
public void FlexibleSchema_BaseTest()
{
- _configuration.FlexibleSchema = true;
+ _configuration.RelaxedSchema = true;
var realm = GetRealm(_configuration);
var person = realm.Write(() =>
From 1ca8e6056b642eb6d6ee958d3b03397a334e2264 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Tue, 25 Jun 2024 16:41:51 +0200
Subject: [PATCH 15/54] Test marshaled vector
---
Realm/Realm/Handles/ObjectHandle.cs | 6 +++---
wrappers/src/object_cs.cpp | 7 ++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 8b1ec2d156..69b257c47a 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -64,7 +64,7 @@ private static class NativeMethods
public static extern IntPtr set_collection_additional_property(ObjectHandle handle, StringValue propertyName, RealmValueType type, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_additional_properties", CallingConvention = CallingConvention.Cdecl)]
- public static extern StringValue[] get_additional_properties(ObjectHandle handle, out NativeException ex);
+ public static extern MarshaledVector get_additional_properties(ObjectHandle handle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_create_embedded", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_embedded_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
@@ -340,8 +340,8 @@ public IEnumerable GetAdditionalProperties()
nativeException.ThrowIfNecessary();
//TODO We should not get empty null values here, so this is mostly to make the warning go away
- //Need to fix this
- return value.Select(v => v.ToDotnetString() ?? string.Empty);
+ // We can probably improve the conversion;
+ return value.ToEnumerable().Select(v => v.ToDotnetString(true) ?? string.Empty);
}
public long AddInt64(IntPtr propertyIndex, long value)
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 6c865164ce..01b3b714c4 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -224,14 +224,15 @@ extern "C" {
return handle_errors(ex, [&]() {
auto props = object.get_obj().get_additional_properties();
+ std::vector realm_string_array;
+
size_t size = props.size();
- realm_string_t* realm_string_array = new realm_string_t[size];
for (size_t i = 0; i < size; ++i) {
- realm_string_array[i] = to_capi(props[i]);
+ realm_string_array.push_back(to_capi(props[i]));
}
- return realm_string_array;
+ return MarshaledVector(realm_string_array);
});
}
From 5c60adfc9323c4cb486d538fa923360286990c72 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 1 Jul 2024 12:53:24 +0200
Subject: [PATCH 16/54] Improvements
---
Realm/Realm/Handles/ObjectHandle.cs | 14 ++++++------
Realm/Realm/Schema/ObjectSchema.cs | 1 +
.../Database/DynamicAccessTests.cs | 22 +++++++++++++++++--
wrappers/src/marshalling.hpp | 5 +++++
wrappers/src/object_cs.cpp | 11 +++++-----
5 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 69b257c47a..ee2667d098 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -193,7 +193,7 @@ public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
return new RealmValue(result, realm, this, propertyIndex);
}
- else
+ else if(realm.Config.RelaxedSchema)
{
using Arena arena = new();
var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
@@ -278,10 +278,8 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
handles?.Dispose();
nativeException.ThrowIfNecessary();
}
- else
+ else if(realm.Config.RelaxedSchema)
{
- //TODO Eventually merge with the previous case
- //TODO Probably this can be improved
using Arena arena = new();
var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
@@ -327,6 +325,8 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
public void UnsetProperty(string propertyName)
{
+ EnsureIsOpen();
+
using Arena arena = new();
var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
@@ -336,12 +336,12 @@ public void UnsetProperty(string propertyName)
public IEnumerable GetAdditionalProperties()
{
+ EnsureIsOpen();
+
var value = NativeMethods.get_additional_properties(this, out var nativeException);
nativeException.ThrowIfNecessary();
- //TODO We should not get empty null values here, so this is mostly to make the warning go away
- // We can probably improve the conversion;
- return value.ToEnumerable().Select(v => v.ToDotnetString(true) ?? string.Empty);
+ return value.ToEnumerable().Select(v => v.ToDotnetString()!);
}
public long AddInt64(IntPtr propertyIndex, long value)
diff --git a/Realm/Realm/Schema/ObjectSchema.cs b/Realm/Realm/Schema/ObjectSchema.cs
index ac45931e91..52841eb8f8 100644
--- a/Realm/Realm/Schema/ObjectSchema.cs
+++ b/Realm/Realm/Schema/ObjectSchema.cs
@@ -103,6 +103,7 @@ private ObjectSchema(string name, ObjectType schemaType, IDictionary { 1, "test", true };
+ // Additional properties should be empty in the beginning
+ Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.Empty);
+
// Basic set/get
realm.Write(() =>
{
@@ -1031,8 +1050,7 @@ public void FlexibleSchema_BaseTest()
Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
// Get all additional properties keys
- var additionalProperties = person.DynamicApi.GetAdditionalProperties();
- Assert.That(additionalProperties, Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
+ Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
}
#endregion
diff --git a/wrappers/src/marshalling.hpp b/wrappers/src/marshalling.hpp
index b1bff56675..2241359ef4 100644
--- a/wrappers/src/marshalling.hpp
+++ b/wrappers/src/marshalling.hpp
@@ -124,6 +124,11 @@ typedef struct realm_string {
size_t size;
} realm_string_t;
+typedef struct realm_string_collection {
+ const realm_string_t* data;
+ size_t size;
+} realm_string_collection_t;
+
typedef struct realm_binary {
const uint8_t* data;
size_t size;
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 01b3b714c4..d9c9a1d3c9 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -219,20 +219,21 @@ extern "C" {
});
}
- REALM_EXPORT realm_string_t* object_get_additional_properties(Object& object, NativeException::Marshallable& ex)
+ //realm_string_collection_t is equivalent to MarshaledVector but that cannot be used
+ //TODO need to see if we can do this differently
+ REALM_EXPORT realm_string_collection_t object_get_additional_properties(Object& object, NativeException::Marshallable& ex)
{
return handle_errors(ex, [&]() {
auto props = object.get_obj().get_additional_properties();
- std::vector realm_string_array;
-
size_t size = props.size();
+ realm_string_t* array = new realm_string_t[size];
for (size_t i = 0; i < size; ++i) {
- realm_string_array.push_back(to_capi(props[i]));
+ array[i] = to_capi(props[i]);
}
- return MarshaledVector(realm_string_array);
+ return realm_string_collection_t{ array, size };
});
}
From ee2e4b9b4af0ad61b99ed62540cb33441caf3c45 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 10 Jul 2024 15:09:51 +0200
Subject: [PATCH 17/54] Various fixes
---
.../Accessors/ManagedAccessor.cs | 5 --
Realm/Realm/Dynamic/DynamicObjectApi.cs | 17 ++++---
Realm/Realm/Handles/ObjectHandle.cs | 47 ++++++++++++-------
.../Database/DynamicAccessTests.cs | 19 +-------
wrappers/src/object_cs.cpp | 12 ++---
5 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
index 80d56871a0..22382bdb36 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
@@ -120,11 +120,6 @@ public void UnsetProperty(string propertyName)
ObjectHandle.UnsetProperty(propertyName);
}
- //TODO Add docs / fix name
- public IEnumerable GetAdditionalProperties()
- {
- return ObjectHandle.GetAdditionalProperties();
- }
///
public void SetValueUnique(string propertyName, RealmValue val)
diff --git a/Realm/Realm/Dynamic/DynamicObjectApi.cs b/Realm/Realm/Dynamic/DynamicObjectApi.cs
index 88ae1597a1..80a4f49d1c 100644
--- a/Realm/Realm/Dynamic/DynamicObjectApi.cs
+++ b/Realm/Realm/Dynamic/DynamicObjectApi.cs
@@ -90,6 +90,17 @@ public RealmValue Get(string propertyName)
}
}
+ public bool TryGet(string propertyName, out T propertyValue)
+ {
+ return TryGet(propertyName, out propertyValue);
+ }
+
+ public bool TryGet(string propertyName, out RealmValue propertyValue)
+ {
+ propertyValue = Get(propertyName);
+ return true;
+ }
+
///
/// Sets the value of the property at to
/// .
@@ -143,12 +154,6 @@ public void Unset(string propertyName)
_managedAccessor.UnsetProperty(propertyName);
}
- //TODO Add docs / fix name
- public IEnumerable GetAdditionalProperties()
- {
- return _managedAccessor.GetAdditionalProperties();
- }
-
///
/// Gets the value of a backlink property. This property must have been declared
/// explicitly and annotated with .
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index ee2667d098..e12661992e 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -51,18 +51,19 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_unset_property", CallingConvention = CallingConvention.Cdecl)]
public static extern void unset_property(ObjectHandle handle, StringValue propertyName, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_additional_property", CallingConvention = CallingConvention.Cdecl)]
- public static extern void get_additional_property(ObjectHandle handle, StringValue propertyName, out PrimitiveValue value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_value_by_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void get_value_by_name(ObjectHandle handle, StringValue propertyName, out PrimitiveValue value, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_additional_property", CallingConvention = CallingConvention.Cdecl)]
- public static extern void set_additional_property(ObjectHandle handle, StringValue propertyName, PrimitiveValue value, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_value_by_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void set_value_by_name(ObjectHandle handle, StringValue propertyName, PrimitiveValue value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_value", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr set_collection_value(ObjectHandle handle, IntPtr propertyIndex, RealmValueType type, out NativeException ex);
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_additional_property", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr set_collection_additional_property(ObjectHandle handle, StringValue propertyName, RealmValueType type, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_collection_value_by_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr set_collection_value_by_name(ObjectHandle handle, StringValue propertyName, RealmValueType type, out NativeException ex);
+ //TODO Need to check if this works with .NET Framework
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_additional_properties", CallingConvention = CallingConvention.Cdecl)]
public static extern MarshaledVector get_additional_properties(ObjectHandle handle, out NativeException ex);
@@ -186,30 +187,44 @@ public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
{
EnsureIsOpen();
- if(metadata.GetPropertyIndexNullable(propertyName) is IntPtr propertyIndex)
+ //TODO Can we merge the two branches...?
+
+ if (!realm.Config.RelaxedSchema)
{
+ var propertyIndex = metadata.GetPropertyIndex(propertyName);
NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
nativeException.ThrowIfNecessary();
return new RealmValue(result, realm, this, propertyIndex);
}
- else if(realm.Config.RelaxedSchema)
+ else
{
- using Arena arena = new();
- var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
+ if (metadata.GetPropertyIndexNullable(propertyName) is IntPtr propertyIndex)
+ {
+ NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
+ nativeException.ThrowIfNecessary();
- NativeMethods.get_additional_property(this, propertyNameNative, out var result, out var nativeException);
- nativeException.ThrowIfNecessary();
+ return new RealmValue(result, realm, this, propertyIndex);
+ }
+ else
+ {
+ using Arena arena = new();
+ var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
- return new RealmValue(result, realm, this);
- }
+ NativeMethods.get_value_by_name(this, propertyNameNative, out var result, out var nativeException);
+ nativeException.ThrowIfNecessary();
+ return new RealmValue(result, realm, this);
+ }
+ }
}
public void SetValue(string propertyName, Metadata metadata, in RealmValue value, Realm realm)
{
EnsureIsOpen();
+ //TODO Can we merge the two branches...?
+
if (metadata.GetPropertyIndexNullable(propertyName) is IntPtr propertyIndex)
{
// We need to special-handle objects because they need to be managed before we can set them.
@@ -298,7 +313,7 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
}
else if (value.Type.IsCollection())
{
- var collectionPtr = NativeMethods.set_collection_additional_property(this, propertyNameNative, value.Type, out var collNativeException);
+ var collectionPtr = NativeMethods.set_collection_value_by_name(this, propertyNameNative, value.Type, out var collNativeException);
collNativeException.ThrowIfNecessary();
switch (value.Type)
@@ -317,7 +332,7 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
}
var (primitive, handles) = value.ToNative();
- NativeMethods.set_additional_property(this, propertyNameNative, primitive, out var nativeException);
+ NativeMethods.set_value_by_name(this, propertyNameNative, primitive, out var nativeException);
handles?.Dispose();
nativeException.ThrowIfNecessary();
}
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 7eb47b1daf..c36709cc40 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -983,21 +983,6 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
#region Flexible schema
- /* To test:
- * - opening same realm with or without relaxed schema (need to decide on behavior=
- * - notifications
- * - keypath filtering
- * - method to check if object has a certain additional property
- * - unset a property in strict schema
- * - mapped properties
- * - dynamic objects
- */
-
- /* To do:
- * - add checks
- * - add method to check if object has a certain additional property
- */
-
[Test]
public void FlexibleSchema_BaseTest()
{
@@ -1013,7 +998,7 @@ public void FlexibleSchema_BaseTest()
var testList = new List { 1, "test", true };
// Additional properties should be empty in the beginning
- Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.Empty);
+ // Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.Empty);
// Basic set/get
realm.Write(() =>
@@ -1050,7 +1035,7 @@ public void FlexibleSchema_BaseTest()
Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
// Get all additional properties keys
- Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
+ // Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
}
#endregion
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index d9c9a1d3c9..24b1147fca 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -128,19 +128,19 @@ extern "C" {
});
}
- REALM_EXPORT void object_get_additional_property(const Object& object, realm_string_t property_name, realm_value_t* value, NativeException::Marshallable& ex)
+ REALM_EXPORT void object_get_value_by_name(const Object& object, realm_string_t property_name, realm_value_t* value, NativeException::Marshallable& ex)
{
handle_errors(ex, [&]() {
verify_can_get(object);
- auto val = object.get_obj().get_additional_prop(capi_to_std(property_name));
+ auto val = object.get_obj().get_any(capi_to_std(property_name));
if (val.is_null())
{
*value = to_capi(val);
return;
}
-
+ //TODO This should be different probably
Path path = { PathElement(capi_to_std(property_name)) };
switch (val.get_type()) {
@@ -203,11 +203,11 @@ extern "C" {
});
}
- REALM_EXPORT void object_set_additional_property(Object& object, realm_string_t property_name, realm_value_t value, NativeException::Marshallable& ex)
+ REALM_EXPORT void object_set_value_by_name(Object& object, realm_string_t property_name, realm_value_t value, NativeException::Marshallable& ex)
{
handle_errors(ex, [&]() {
verify_can_set(object);
- object.get_obj().set_additional_prop(capi_to_std(property_name), from_capi(value));
+ object.get_obj().set_any(capi_to_std(property_name), from_capi(value));
});
}
@@ -266,7 +266,7 @@ extern "C" {
});
}
- REALM_EXPORT void* object_set_collection_additional_property(Object& object,
+ REALM_EXPORT void* object_set_collection_value_by_name(Object& object,
realm_string_t property_name, realm_value_type type, NativeException::Marshallable& ex)
{
return handle_errors(ex, [&]()-> void* {
From ac19189d362ce3210946b603eb1656f6dcf3dff8 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 10 Jul 2024 15:10:45 +0200
Subject: [PATCH 18/54] Updated core [skip-ci]
---
wrappers/realm-core | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wrappers/realm-core b/wrappers/realm-core
index 4fa42845aa..3cd67a8a1d 160000
--- a/wrappers/realm-core
+++ b/wrappers/realm-core
@@ -1 +1 @@
-Subproject commit 4fa42845aab6c74739fb30b9f54b1f36397bd6a8
+Subproject commit 3cd67a8a1d60256102e7ac810366dd99bdb65e20
From 0060357bd26c455c3cfe635137b1bd21fff2837a Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 10 Jul 2024 17:46:55 +0200
Subject: [PATCH 19/54] Added try methods
---
.../Accessors/ManagedAccessor.cs | 11 ++++
Realm/Realm/Dynamic/DynamicObjectApi.cs | 48 ++++++++++++--
Realm/Realm/Handles/ObjectHandle.cs | 40 +++++++++---
.../Database/DynamicAccessTests.cs | 63 ++++++++++++++++++-
wrappers/src/object_cs.cpp | 38 ++++++++---
5 files changed, 176 insertions(+), 24 deletions(-)
diff --git a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
index 22382bdb36..46bd679ae9 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
@@ -108,6 +108,12 @@ public RealmValue GetValue(string propertyName)
return ObjectHandle.GetValue(propertyName, Metadata, Realm);
}
+ ///
+ public bool TryGetValue(string propertyName, out RealmValue value)
+ {
+ return ObjectHandle.TryGetValue(propertyName, Metadata, Realm, out value);
+ }
+
///
public void SetValue(string propertyName, RealmValue val)
{
@@ -120,6 +126,11 @@ public void UnsetProperty(string propertyName)
ObjectHandle.UnsetProperty(propertyName);
}
+ //TODO Add docs
+ public bool TryUnsetProperty(string propertyName)
+ {
+ return ObjectHandle.TryUnsetProperty(propertyName);
+ }
///
public void SetValueUnique(string propertyName, RealmValue val)
diff --git a/Realm/Realm/Dynamic/DynamicObjectApi.cs b/Realm/Realm/Dynamic/DynamicObjectApi.cs
index 80a4f49d1c..e021967e42 100644
--- a/Realm/Realm/Dynamic/DynamicObjectApi.cs
+++ b/Realm/Realm/Dynamic/DynamicObjectApi.cs
@@ -90,15 +90,49 @@ public RealmValue Get(string propertyName)
}
}
- public bool TryGet(string propertyName, out T propertyValue)
+ public bool TryGet(string propertyName, out T? propertyValue)
{
- return TryGet(propertyName, out propertyValue);
+ var foundValue = TryGet(propertyName, out var val);
+ if (foundValue)
+ {
+ propertyValue = val.As();
+ return true;
+ }
+
+ propertyValue = default;
+ return false;
}
public bool TryGet(string propertyName, out RealmValue propertyValue)
{
- propertyValue = Get(propertyName);
- return true;
+ if (GetProperty(propertyName) is Property property)
+ {
+ if (property.Type.IsComputed())
+ {
+ throw new NotSupportedException(
+ $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} (backlinks collection) and can't be accessed using {nameof(Dynamic)}.{nameof(Get)}. Use {nameof(GetBacklinks)} instead.");
+ }
+
+ if (property.Type.IsCollection(out var collectionType))
+ {
+ var collectionMethodName = collectionType switch
+ {
+ PropertyType.Array => "GetList",
+ PropertyType.Set => "GetSet",
+ PropertyType.Dictionary => "GetDictionary",
+ _ => throw new NotSupportedException($"Invalid collection type received: {collectionType}")
+ };
+
+ throw new NotSupportedException(
+ $"{_managedAccessor.ObjectSchema.Name}.{propertyName} is {property.GetDotnetTypeName()} and can't be accessed using {nameof(Dynamic)}.{nameof(Get)}. Use {collectionMethodName} instead.");
+ }
+
+ return _managedAccessor.TryGetValue(propertyName, out propertyValue);
+ }
+ else
+ {
+ return _managedAccessor.TryGetValue(propertyName, out propertyValue);
+ }
}
///
@@ -154,6 +188,12 @@ public void Unset(string propertyName)
_managedAccessor.UnsetProperty(propertyName);
}
+ //TODO Add docs
+ public bool TryUnset(string propertyName)
+ {
+ return _managedAccessor.TryUnsetProperty(propertyName);
+ }
+
///
/// Gets the value of a backlink property. This property must have been declared
/// explicitly and annotated with .
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index e12661992e..94d1891cf7 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -49,10 +49,10 @@ private static class NativeMethods
public static extern void set_value(ObjectHandle handle, IntPtr propertyIndex, PrimitiveValue value, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_unset_property", CallingConvention = CallingConvention.Cdecl)]
- public static extern void unset_property(ObjectHandle handle, StringValue propertyName, out NativeException ex);
+ public static extern bool unset_property(ObjectHandle handle, StringValue propertyName, bool throw_on_unsuccessful, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_value_by_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern void get_value_by_name(ObjectHandle handle, StringValue propertyName, out PrimitiveValue value, out NativeException ex);
+ public static extern bool get_value_by_name(ObjectHandle handle, StringValue propertyName, out PrimitiveValue value, bool throw_on_missing_property, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_set_value_by_name", CallingConvention = CallingConvention.Cdecl)]
public static extern void set_value_by_name(ObjectHandle handle, StringValue propertyName, PrimitiveValue value, out NativeException ex);
@@ -184,6 +184,18 @@ public RealmSchema GetSchema()
}
public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
+ {
+ TryGetValueInternal(propertyName, metadata, realm, out var value, throwOnMissingProperty: true);
+ return value;
+ }
+
+ public bool TryGetValue(string propertyName, Metadata metadata, Realm realm, out RealmValue value)
+ {
+ return TryGetValueInternal(propertyName, metadata, realm, out value, throwOnMissingProperty: false);
+ }
+
+ internal bool TryGetValueInternal(string propertyName, Metadata metadata, Realm realm, out RealmValue value,
+ bool throwOnMissingProperty)
{
EnsureIsOpen();
@@ -195,7 +207,8 @@ public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
nativeException.ThrowIfNecessary();
- return new RealmValue(result, realm, this, propertyIndex);
+ value = new RealmValue(result, realm, this, propertyIndex);
+ return true;
}
else
{
@@ -204,17 +217,19 @@ public RealmValue GetValue(string propertyName, Metadata metadata, Realm realm)
NativeMethods.get_value(this, propertyIndex, out var result, out var nativeException);
nativeException.ThrowIfNecessary();
- return new RealmValue(result, realm, this, propertyIndex);
+ value = new RealmValue(result, realm, this, propertyIndex);
+ return true;
}
else
{
using Arena arena = new();
var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
- NativeMethods.get_value_by_name(this, propertyNameNative, out var result, out var nativeException);
+ var propFound = NativeMethods.get_value_by_name(this, propertyNameNative, out var result, throwOnMissingProperty, out var nativeException);
nativeException.ThrowIfNecessary();
- return new RealmValue(result, realm, this);
+ value = new RealmValue(result, realm, this);
+ return propFound;
}
}
}
@@ -339,14 +354,25 @@ public void SetValue(string propertyName, Metadata metadata, in RealmValue value
}
public void UnsetProperty(string propertyName)
+ {
+ TryUnsetPropertyInternal(propertyName, throwOnUnsuccessful: true);
+ }
+
+ public bool TryUnsetProperty(string propertyName)
+ {
+ return TryUnsetPropertyInternal(propertyName, throwOnUnsuccessful: false);
+ }
+
+ public bool TryUnsetPropertyInternal(string propertyName, bool throwOnUnsuccessful)
{
EnsureIsOpen();
using Arena arena = new();
var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
- NativeMethods.unset_property(this, propertyNameNative, out var nativeException);
+ var propertyFound = NativeMethods.unset_property(this, propertyNameNative, throwOnUnsuccessful, out var nativeException);
nativeException.ThrowIfNecessary();
+ return propertyFound;
}
public IEnumerable GetAdditionalProperties()
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index c36709cc40..274c08fdad 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -982,7 +982,6 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
#region Flexible schema
-
[Test]
public void FlexibleSchema_BaseTest()
{
@@ -1016,6 +1015,16 @@ public void FlexibleSchema_BaseTest()
Assert.That(person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
Assert.That(person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
+ bool found;
+
+ found = person.DynamicApi.TryGet("propString", out var stringVal);
+ Assert.That(found, Is.True);
+ Assert.That(stringVal, Is.EqualTo("testval"));
+
+ found = person.DynamicApi.TryGet>("propList", out var listVal);
+ Assert.That(found, Is.True);
+ Assert.That(listVal, Is.EqualTo(testList));
+
// Change type
realm.Write(() =>
{
@@ -1025,14 +1034,62 @@ public void FlexibleSchema_BaseTest()
Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo(23));
// Get unknown property
- Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+
+ // TryGet unknown property
+ found = person.DynamicApi.TryGet("unknonProp", out var rvUnKnownValue);
+ Assert.That(found, Is.False);
+ Assert.That(rvUnKnownValue, Is.EqualTo(RealmValue.Null));
+
+ found = person.DynamicApi.TryGet("unknonProp", out var intUnknownVal);
+ Assert.That(found, Is.False);
+ Assert.That(intUnknownVal, Is.EqualTo(default(int)));
+
+ found = person.DynamicApi.TryGet>("unknonProp", out var listUnknonwVal);
+ Assert.That(found, Is.False);
+ Assert.That(listUnknonwVal, Is.EqualTo(default(IList)));
// Unset property
realm.Write(() =>
{
person.DynamicApi.Unset("propString");
});
- Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
+ Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
+
+ Assert.That(() => realm.Write(() =>
+ {
+ person.DynamicApi.Unset("propString");
+ }), Throws.TypeOf().With.Message.EqualTo("Could not erase property: propString"));
+
+ // Unset property in schema
+ Assert.That(() => realm.Write(() =>
+ {
+ person.DynamicApi.Unset("FirstName");
+ }), Throws.TypeOf().With.Message.EqualTo("Could not erase property: FirstName"));
+
+ // TryUnset property
+ realm.Write(() =>
+ {
+ bool unsetVal = person.DynamicApi.TryUnset("propInt");
+ Assert.That(unsetVal, Is.True);
+ });
+ Assert.That(() => person.DynamicApi.Get("propInt"), Throws.TypeOf().With.Message.EqualTo("Property not found: propInt"));
+
+ realm.Write(() =>
+ {
+ bool unsetVal = person.DynamicApi.TryUnset("propInt");
+ Assert.That(unsetVal, Is.False);
+ });
+
+ // TryUnset property in schema
+ // We need to get a new core method to check if a certain property in the extra
+ // properties
+ //realm.Write(() =>
+ //{
+ // bool unsetVal = person.DynamicApi.TryUnset("FirstName");
+ // Assert.That(unsetVal, Is.False);
+ //});
// Get all additional properties keys
// Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 24b1147fca..706db9ff25 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -128,32 +128,41 @@ extern "C" {
});
}
- REALM_EXPORT void object_get_value_by_name(const Object& object, realm_string_t property_name, realm_value_t* value, NativeException::Marshallable& ex)
+ REALM_EXPORT bool object_get_value_by_name(const Object& object, realm_string_t property_name, realm_value_t* value, bool throw_on_missing_property,
+ NativeException::Marshallable& ex)
{
- handle_errors(ex, [&]() {
+ return handle_errors(ex, [&]() {
verify_can_get(object);
- auto val = object.get_obj().get_any(capi_to_std(property_name));
+ auto prop_name = capi_to_std(property_name);
+
+ if (!throw_on_missing_property && !object.get_obj().has_property(prop_name))
+ {
+ *value = realm_value_t{};
+ return false;
+ }
+
+ auto val = object.get_obj().get_any(prop_name);
if (val.is_null())
{
*value = to_capi(val);
- return;
+ return true;
}
- //TODO This should be different probably
- Path path = { PathElement(capi_to_std(property_name)) };
switch (val.get_type()) {
case type_TypedLink:
*value = to_capi(val.get(), object.realm());
break;
case type_List:
- *value = to_capi(new List(object.realm(), object.get_obj().get_list_ptr(path)));
+ *value = to_capi(new List(object.realm(), object.get_obj().get_list_ptr(prop_name)));
break;
default:
*value = to_capi(std::move(val));
break;
}
+
+ return true;
});
}
@@ -211,11 +220,20 @@ extern "C" {
});
}
- REALM_EXPORT void object_unset_property(Object& object, realm_string_t property_name, NativeException::Marshallable& ex)
+ REALM_EXPORT bool object_unset_property(Object& object, realm_string_t property_name,
+ bool throw_on_unsuccessful, NativeException::Marshallable& ex)
{
- handle_errors(ex, [&]() {
+ return handle_errors(ex, [&]() {
verify_can_set(object);
- object.get_obj().erase_prop(capi_to_std(property_name));
+ auto prop_name = capi_to_std(property_name);
+
+ //This should be has_additional_property
+ if (!throw_on_unsuccessful && !object.get_obj().has_property(prop_name))
+ {
+ return false;
+ }
+
+ object.get_obj().erase_prop(prop_name);
});
}
From 6c9e74d63fb1cc8112dc530212cbcd3832c92ad6 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 17 Jul 2024 12:41:03 +0200
Subject: [PATCH 20/54] Added extended schema
---
Realm/Realm/DatabaseTypes/Metadata.cs | 2 +-
Realm/Realm/Schema/ExtendedObjectSchema.cs | 41 ++++++++++++++++++++++
Realm/Realm/Schema/ObjectSchema.cs | 4 ++-
3 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 Realm/Realm/Schema/ExtendedObjectSchema.cs
diff --git a/Realm/Realm/DatabaseTypes/Metadata.cs b/Realm/Realm/DatabaseTypes/Metadata.cs
index bc6654a5f6..7d6ff28a32 100644
--- a/Realm/Realm/DatabaseTypes/Metadata.cs
+++ b/Realm/Realm/DatabaseTypes/Metadata.cs
@@ -53,7 +53,7 @@ public IntPtr GetPropertyIndex(string propertyName)
throw new MissingMemberException(Schema.Name, propertyName);
}
- //TODO Should merge with the previous one
+ //TODO Should merge with the previous one?
public IntPtr? GetPropertyIndexNullable(string propertyName)
{
if (PropertyIndices.TryGetValue(propertyName, out var result))
diff --git a/Realm/Realm/Schema/ExtendedObjectSchema.cs b/Realm/Realm/Schema/ExtendedObjectSchema.cs
new file mode 100644
index 0000000000..7d78cf0f98
--- /dev/null
+++ b/Realm/Realm/Schema/ExtendedObjectSchema.cs
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2023 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System.Collections;
+using System.Collections.Generic;
+using Realms.Native;
+
+namespace Realms.Schema
+{
+ public class ExtendedObjectSchema : ObjectSchema
+ {
+ private ObjectHandle _objectHandle;
+
+ //TODO We can probably improve the constructor, so it doesn't loop through the properties again
+ internal ExtendedObjectSchema(ObjectSchema schema, ObjectHandle objectHandle)
+ : base(schema.Name, schema.BaseType, schema.Properties)
+ {
+ _objectHandle = objectHandle;
+ }
+
+ public IEnumerable GetExtraProperties()
+ {
+ return _objectHandle.GetExtraProperties();
+ }
+ }
+}
diff --git a/Realm/Realm/Schema/ObjectSchema.cs b/Realm/Realm/Schema/ObjectSchema.cs
index 52841eb8f8..6c0b35fe1d 100644
--- a/Realm/Realm/Schema/ObjectSchema.cs
+++ b/Realm/Realm/Schema/ObjectSchema.cs
@@ -77,6 +77,8 @@ public enum ObjectType : byte
internal Type? Type { get; private set; }
+ internal ReadOnlyDictionary Properties => _properties;
+
///
/// Gets a indicating whether this describes
/// a top level object, an embedded object or an asymmetric object.
@@ -84,7 +86,7 @@ public enum ObjectType : byte
/// The type of ObjectSchema.
public ObjectType BaseType { get; }
- private ObjectSchema(string name, ObjectType schemaType, IDictionary properties)
+ internal ObjectSchema(string name, ObjectType schemaType, IDictionary properties)
{
Name = name;
BaseType = schemaType;
From 69a8a39d68999a10f957a6a3bb031d35b39dfb17 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 17 Jul 2024 12:43:04 +0200
Subject: [PATCH 21/54] rename
---
Realm/Realm/Handles/ObjectHandle.cs | 8 ++++----
wrappers/src/object_cs.cpp | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 94d1891cf7..858749b99f 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -64,8 +64,8 @@ private static class NativeMethods
public static extern IntPtr set_collection_value_by_name(ObjectHandle handle, StringValue propertyName, RealmValueType type, out NativeException ex);
//TODO Need to check if this works with .NET Framework
- [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_additional_properties", CallingConvention = CallingConvention.Cdecl)]
- public static extern MarshaledVector get_additional_properties(ObjectHandle handle, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_extra_properties", CallingConvention = CallingConvention.Cdecl)]
+ public static extern MarshaledVector get_extra_properties(ObjectHandle handle, out NativeException ex);
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_create_embedded", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_embedded_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
@@ -375,11 +375,11 @@ public bool TryUnsetPropertyInternal(string propertyName, bool throwOnUnsuccessf
return propertyFound;
}
- public IEnumerable GetAdditionalProperties()
+ public IEnumerable GetExtraProperties()
{
EnsureIsOpen();
- var value = NativeMethods.get_additional_properties(this, out var nativeException);
+ var value = NativeMethods.get_extra_properties(this, out var nativeException);
nativeException.ThrowIfNecessary();
return value.ToEnumerable().Select(v => v.ToDotnetString()!);
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 706db9ff25..7dc7896847 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -239,7 +239,7 @@ extern "C" {
//realm_string_collection_t is equivalent to MarshaledVector but that cannot be used
//TODO need to see if we can do this differently
- REALM_EXPORT realm_string_collection_t object_get_additional_properties(Object& object, NativeException::Marshallable& ex)
+ REALM_EXPORT realm_string_collection_t object_get_extra_properties(Object& object, NativeException::Marshallable& ex)
{
return handle_errors(ex, [&]() {
auto props = object.get_obj().get_additional_properties();
From c45ace8252acc1389b1977d6f9152213d7972b25 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 17 Jul 2024 14:08:47 +0200
Subject: [PATCH 22/54] Small fix
---
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 274c08fdad..084b7c89cc 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -996,8 +996,8 @@ public void FlexibleSchema_BaseTest()
var testObj = new Person { FirstName = "Luigi" };
var testList = new List { 1, "test", true };
- // Additional properties should be empty in the beginning
- // Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.Empty);
+ //Additional properties should be empty in the beginning
+ Assert.That(person.ObjectSchema.GetExtraProperties(), Is.Empty);
// Basic set/get
realm.Write(() =>
@@ -1083,7 +1083,7 @@ public void FlexibleSchema_BaseTest()
});
// TryUnset property in schema
- // We need to get a new core method to check if a certain property in the extra
+ // We need to get a new core method to check if a certain property is in the extra
// properties
//realm.Write(() =>
//{
From 382779055b20d63e92eba5ea18a80fa0e88bdc49 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Wed, 17 Jul 2024 14:35:24 +0200
Subject: [PATCH 23/54] Addded extended property object
---
Realm/Realm.SourceGenerator/ClassCodeBuilder.cs | 4 ++++
Realm/Realm/DatabaseTypes/Accessors/IRealmAccessor.cs | 5 +++++
Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs | 4 ++++
Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs | 2 ++
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 6 +++---
.../Realms.SourceGenerator.RealmGenerator/A_generated.cs | 4 ++++
.../AgedObject_generated.cs | 4 ++++
.../AllTypesObject_generated.cs | 4 ++++
.../AsymmetricObjectWithAllTypes_generated.cs | 4 ++++
...symmetricObjectWithEmbeddedDictionaryObject_generated.cs | 4 ++++
.../AsymmetricObjectWithEmbeddedListObject_generated.cs | 4 ++++
...AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs | 4 ++++
.../Realms.SourceGenerator.RealmGenerator/B_generated.cs | 4 ++++
.../BacklinkObject_generated.cs | 4 ++++
.../Bar_DuplicateClass_generated.cs | 4 ++++
.../BasicAsymmetricObject_generated.cs | 4 ++++
.../Child_generated.cs | 4 ++++
.../Cities_generated.cs | 4 ++++
.../ClassWithUnqueryableMembers_generated.cs | 4 ++++
.../CollectionsObject_generated.cs | 4 ++++
.../Company_generated.cs | 4 ++++
.../CompletionReport_generated.cs | 4 ++++
.../ContainerObject_generated.cs | 4 ++++
.../CoordinatesEmbeddedObject_generated.cs | 4 ++++
.../CounterObject_generated.cs | 4 ++++
.../CustomGeoPoint_generated.cs | 4 ++++
.../DecimalsObject_generated.cs | 4 ++++
.../DeepObject1_generated.cs | 4 ++++
.../DeepObject2_generated.cs | 4 ++++
.../DeepObject3_generated.cs | 4 ++++
.../DeepObject4_generated.cs | 4 ++++
.../DeepObject5_generated.cs | 4 ++++
.../DictionariesObject_generated.cs | 4 ++++
.../Realms.SourceGenerator.RealmGenerator/Dog_generated.cs | 4 ++++
.../Dotnet_3597_Old_generated.cs | 4 ++++
.../Dotnet_3597_generated.cs | 4 ++++
.../DynamicDog_generated.cs | 4 ++++
.../DynamicOwner_generated.cs | 4 ++++
.../DynamicSubSubTask_generated.cs | 4 ++++
.../DynamicSubTask_generated.cs | 4 ++++
.../DynamicTask_generated.cs | 4 ++++
.../EmbeddedAllTypesObject_generated.cs | 4 ++++
.../EmbeddedGuidType_generated.cs | 4 ++++
.../EmbeddedIntPropertyObject_generated.cs | 4 ++++
.../EmbeddedLevel1_generated.cs | 4 ++++
.../EmbeddedLevel2_generated.cs | 4 ++++
.../EmbeddedLevel3_generated.cs | 4 ++++
.../ExplicitClass_generated.cs | 4 ++++
.../Foo_DuplicateClass_generated.cs | 4 ++++
.../GuidType_generated.cs | 4 ++++
.../HugeSyncObject_generated.cs | 4 ++++
.../IndexedDateTimeOffsetObject_generated.cs | 4 ++++
.../IndexedRealmValueObject_generated.cs | 4 ++++
.../IndexesClass_generated.cs | 4 ++++
.../InitializedFieldObject_generated.cs | 4 ++++
.../IntPrimaryKeyWithValueObject_generated.cs | 4 ++++
.../IntPropertyObject_generated.cs | 4 ++++
.../InternalObject_generated.cs | 4 ++++
.../Level1_generated.cs | 4 ++++
.../Level2_generated.cs | 4 ++++
.../Level3_generated.cs | 4 ++++
.../LinksObject_generated.cs | 4 ++++
.../ListsObject_generated.cs | 4 ++++
.../LoneClass_generated.cs | 4 ++++
.../MixedProperties1_generated.cs | 4 ++++
.../MixedProperties2_generated.cs | 4 ++++
.../NoListProperties_generated.cs | 4 ++++
.../NonPrimaryKeyObject_generated.cs | 4 ++++
.../NonPrimaryKeyWithNonPKRelation_generated.cs | 4 ++++
.../NonPrimaryKeyWithPKRelation_generated.cs | 4 ++++
.../NullablePrimaryKeyObject_generated.cs | 4 ++++
.../NullablesV0_generated.cs | 4 ++++
.../NullablesV1_generated.cs | 4 ++++
.../ObjectContainerEmbedded_generated.cs | 4 ++++
.../ObjectContainerV1_generated.cs | 4 ++++
.../ObjectEmbedded_generated.cs | 4 ++++
.../ObjectIdPrimaryKeyWithValueObject_generated.cs | 4 ++++
.../ObjectV1_generated.cs | 4 ++++
.../ObjectV2_generated.cs | 4 ++++
.../ObjectWithEmbeddedProperties_generated.cs | 4 ++++
.../ObjectWithFtsIndex_generated.cs | 4 ++++
.../ObjectWithInvalidGeoPoints_generated.cs | 4 ++++
.../ObjectWithObjectProperties_generated.cs | 4 ++++
.../ObjectWithPartitionValue_generated.cs | 4 ++++
.../ObjectWithRequiredStringList_generated.cs | 4 ++++
.../OnManagedTestClass_generated.cs | 4 ++++
.../OneListProperty_generated.cs | 4 ++++
.../OneNonListProperty_generated.cs | 4 ++++
.../OnlyListProperties_generated.cs | 4 ++++
.../OrderedContainer_generated.cs | 4 ++++
.../OrderedObject_generated.cs | 4 ++++
.../Owner_generated.cs | 4 ++++
.../Parent_generated.cs | 4 ++++
.../Person_generated.cs | 4 ++++
.../PrimaryKeyByteObject_generated.cs | 4 ++++
.../PrimaryKeyCharObject_generated.cs | 4 ++++
.../PrimaryKeyGuidObject_generated.cs | 4 ++++
.../PrimaryKeyInt16Object_generated.cs | 4 ++++
.../PrimaryKeyInt32Object_generated.cs | 4 ++++
.../PrimaryKeyInt64Object_generated.cs | 4 ++++
.../PrimaryKeyNullableByteObject_generated.cs | 4 ++++
.../PrimaryKeyNullableCharObject_generated.cs | 4 ++++
.../PrimaryKeyNullableGuidObject_generated.cs | 4 ++++
.../PrimaryKeyNullableInt16Object_generated.cs | 4 ++++
.../PrimaryKeyNullableInt32Object_generated.cs | 4 ++++
.../PrimaryKeyNullableInt64Object_generated.cs | 4 ++++
.../PrimaryKeyNullableObjectIdObject_generated.cs | 4 ++++
.../PrimaryKeyObjectIdObject_generated.cs | 4 ++++
.../PrimaryKeyObject_generated.cs | 4 ++++
.../PrimaryKeyStringObject_generated.cs | 4 ++++
.../PrimaryKeyWithNoPKList_generated.cs | 4 ++++
.../PrimaryKeyWithNonPKChildWithPKGrandChild_generated.cs | 4 ++++
.../PrimaryKeyWithNonPKRelation_generated.cs | 4 ++++
.../PrimaryKeyWithPKList_generated.cs | 4 ++++
.../PrimaryKeyWithPKRelation_generated.cs | 4 ++++
.../PrivatePrimaryKeyObject_generated.cs | 4 ++++
.../Product_generated.cs | 4 ++++
.../RealmValueObject_generated.cs | 4 ++++
.../RecursiveBacklinksObject_generated.cs | 4 ++++
.../RemappedPropertiesObject_generated.cs | 4 ++++
.../RemappedTypeObject_generated.cs | 4 ++++
.../Report_generated.cs | 4 ++++
.../RequiredPrimaryKeyStringObject_generated.cs | 4 ++++
.../RequiredPropertyClass_generated.cs | 4 ++++
.../RequiredStringObject_generated.cs | 4 ++++
.../SerializedObject_generated.cs | 4 ++++
.../SomeClass_generated.cs | 4 ++++
.../SyncAllTypesObject_generated.cs | 4 ++++
.../SyncCollectionsObject_generated.cs | 4 ++++
.../SyncObjectWithRequiredStringList_generated.cs | 4 ++++
.../TestNotificationObject_generated.cs | 4 ++++
.../ThrowsBeforeInitializer_generated.cs | 4 ++++
.../TopLevelGeoPoint_generated.cs | 4 ++++
.../TypeEmbeddedObject_generated.cs | 4 ++++
.../UnqueryableBacklinks_generated.cs | 4 ++++
.../Walker_generated.cs | 4 ++++
wrappers/src/object_cs.cpp | 1 +
137 files changed, 543 insertions(+), 3 deletions(-)
diff --git a/Realm/Realm.SourceGenerator/ClassCodeBuilder.cs b/Realm/Realm.SourceGenerator/ClassCodeBuilder.cs
index 24b30ae249..44798effb4 100644
--- a/Realm/Realm.SourceGenerator/ClassCodeBuilder.cs
+++ b/Realm/Realm.SourceGenerator/ClassCodeBuilder.cs
@@ -319,6 +319,10 @@ private string GeneratePartialClass()
{_ignoreFieldAttribute.Value}
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+///
+{_ignoreFieldAttribute.Value}
+public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
{_ignoreFieldAttribute.Value}
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Realm/Realm/DatabaseTypes/Accessors/IRealmAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/IRealmAccessor.cs
index ef89c9b6c6..9eb1e5d884 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/IRealmAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/IRealmAccessor.cs
@@ -72,6 +72,11 @@ public interface IRealmAccessor
///
ObjectSchema? ObjectSchema { get; }
+ //TODO We need to decide if we want to completely substitute object schema
+ // (probably yes, but then we also need to decide if we want to do the same for RealmObject)
+ ExtendedObjectSchema? ExtendedObjectSchema { get; }
+
+
///
/// Gets the number of objects referring to this one via either a to-one or to-many relationship.
///
diff --git a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
index 46bd679ae9..82a5476d90 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/ManagedAccessor.cs
@@ -62,6 +62,10 @@ public abstract class ManagedAccessor
///
public ObjectSchema ObjectSchema => Metadata.Schema;
+ //TODO This can be cached or done differently
+ ///
+ public ExtendedObjectSchema ExtendedObjectSchema => new (ObjectSchema, ObjectHandle);
+
///
public int BacklinksCount => ObjectHandle?.GetBacklinkCount() ?? 0;
diff --git a/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs
index 4022e94cd4..77af092941 100644
--- a/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs
+++ b/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs
@@ -58,6 +58,8 @@ public abstract class UnmanagedAccessor : IRealmAccessor
///
public DynamicObjectApi DynamicApi => throw new NotSupportedException("Using the dynamic API to access a RealmObject is only possible for managed (persisted) objects.");
+ public ExtendedObjectSchema? ExtendedObjectSchema => null;
+
///
public IRealmObjectBase? GetParent() => null;
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 084b7c89cc..84d7b7477e 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -997,7 +997,7 @@ public void FlexibleSchema_BaseTest()
var testList = new List { 1, "test", true };
//Additional properties should be empty in the beginning
- Assert.That(person.ObjectSchema.GetExtraProperties(), Is.Empty);
+ Assert.That(person.ExtendedObjectSchema.GetExtraProperties(), Is.Empty);
// Basic set/get
realm.Write(() =>
@@ -1091,8 +1091,8 @@ public void FlexibleSchema_BaseTest()
// Assert.That(unsetVal, Is.False);
//});
- // Get all additional properties keys
- // Assert.That(person.DynamicApi.GetAdditionalProperties(), Is.EquivalentTo(new[] { "propInt", "propObj", "propList", "propNull" }));
+ // Get all extra properties keys
+ Assert.That(person.ExtendedObjectSchema.GetExtraProperties(), Is.EquivalentTo(new[] { "propObj", "propList", "propNull" }));
}
#endregion
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/A_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/A_generated.cs
index cf02c99802..d4807af11f 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/A_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/A_generated.cs
@@ -71,6 +71,10 @@ static A()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AgedObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AgedObject_generated.cs
index 7313517ea4..8299921b8b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AgedObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AgedObject_generated.cs
@@ -68,6 +68,10 @@ static AgedObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AllTypesObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AllTypesObject_generated.cs
index e059446d0d..a731de19b9 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AllTypesObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AllTypesObject_generated.cs
@@ -103,6 +103,10 @@ static AllTypesObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs
index 33b7c863d1..94ef09d4f1 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithAllTypes_generated.cs
@@ -101,6 +101,10 @@ static AsymmetricObjectWithAllTypes()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs
index bd0bdbdd69..f62d447484 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedDictionaryObject_generated.cs
@@ -74,6 +74,10 @@ static AsymmetricObjectWithEmbeddedDictionaryObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs
index ee1b1bdd4b..51fc03a23f 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedListObject_generated.cs
@@ -74,6 +74,10 @@ static AsymmetricObjectWithEmbeddedListObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs
index 66d5eaf723..f18b5b0982 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/AsymmetricObjectWithEmbeddedRecursiveObject_generated.cs
@@ -74,6 +74,10 @@ static AsymmetricObjectWithEmbeddedRecursiveObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/B_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/B_generated.cs
index 3a84acc10d..4afb9bb1a1 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/B_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/B_generated.cs
@@ -70,6 +70,10 @@ static B()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BacklinkObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BacklinkObject_generated.cs
index 197f7fc959..bbcab2183e 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BacklinkObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BacklinkObject_generated.cs
@@ -70,6 +70,10 @@ static BacklinkObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Bar_DuplicateClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Bar_DuplicateClass_generated.cs
index 222e79edc9..a8ed4ec7b9 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Bar_DuplicateClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Bar_DuplicateClass_generated.cs
@@ -70,6 +70,10 @@ static DuplicateClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs
index d09f9f138c..f201c9308f 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/BasicAsymmetricObject_generated.cs
@@ -74,6 +74,10 @@ static BasicAsymmetricObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Child_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Child_generated.cs
index efc2fc8460..0e9a8ac13e 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Child_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Child_generated.cs
@@ -72,6 +72,10 @@ static Child()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Cities_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Cities_generated.cs
index cf12d73081..04ac844665 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Cities_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Cities_generated.cs
@@ -68,6 +68,10 @@ static Cities()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ClassWithUnqueryableMembers_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ClassWithUnqueryableMembers_generated.cs
index adaaef4bdb..a1d82e901b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ClassWithUnqueryableMembers_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ClassWithUnqueryableMembers_generated.cs
@@ -74,6 +74,10 @@ static ClassWithUnqueryableMembers()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CollectionsObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CollectionsObject_generated.cs
index 572baad0b5..571d54687e 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CollectionsObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CollectionsObject_generated.cs
@@ -160,6 +160,10 @@ static CollectionsObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Company_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Company_generated.cs
index 0d0d6a9165..5b3f9cec9c 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Company_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Company_generated.cs
@@ -75,6 +75,10 @@ static Company()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CompletionReport_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CompletionReport_generated.cs
index f661e54ba3..c66b7a91a8 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CompletionReport_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CompletionReport_generated.cs
@@ -69,6 +69,10 @@ static CompletionReport()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ContainerObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ContainerObject_generated.cs
index cde09bf778..d0ab397fbe 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ContainerObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ContainerObject_generated.cs
@@ -70,6 +70,10 @@ static ContainerObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CoordinatesEmbeddedObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CoordinatesEmbeddedObject_generated.cs
index 409fd4dd1d..e196570246 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CoordinatesEmbeddedObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CoordinatesEmbeddedObject_generated.cs
@@ -72,6 +72,10 @@ static CoordinatesEmbeddedObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CounterObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CounterObject_generated.cs
index 6643e55f39..0ba294fee9 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CounterObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CounterObject_generated.cs
@@ -78,6 +78,10 @@ static CounterObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CustomGeoPoint_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CustomGeoPoint_generated.cs
index cbb0e1f3f8..9a1198b98b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CustomGeoPoint_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/CustomGeoPoint_generated.cs
@@ -77,6 +77,10 @@ private CustomGeoPoint() {}
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DecimalsObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DecimalsObject_generated.cs
index 30143263dd..dc16a8c1ab 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DecimalsObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DecimalsObject_generated.cs
@@ -71,6 +71,10 @@ static DecimalsObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject1_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject1_generated.cs
index 2dd3ff4f53..485328f240 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject1_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject1_generated.cs
@@ -72,6 +72,10 @@ static DeepObject1()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject2_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject2_generated.cs
index 04456a898c..b24cf451cb 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject2_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject2_generated.cs
@@ -72,6 +72,10 @@ static DeepObject2()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject3_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject3_generated.cs
index 937395b7c0..7a603a032d 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject3_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject3_generated.cs
@@ -72,6 +72,10 @@ static DeepObject3()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject4_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject4_generated.cs
index b29d9a2260..abf9563e34 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject4_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject4_generated.cs
@@ -72,6 +72,10 @@ static DeepObject4()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject5_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject5_generated.cs
index ae0c50bbfa..e240f91239 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject5_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DeepObject5_generated.cs
@@ -71,6 +71,10 @@ static DeepObject5()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DictionariesObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DictionariesObject_generated.cs
index f62d34e928..31c8e6befd 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DictionariesObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DictionariesObject_generated.cs
@@ -101,6 +101,10 @@ static DictionariesObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dog_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dog_generated.cs
index b4003b2c98..87a9531361 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dog_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dog_generated.cs
@@ -74,6 +74,10 @@ static Dog()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs
index 766ed07f4f..b5ba136d58 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_Old_generated.cs
@@ -72,6 +72,10 @@ static Dotnet_3597_Old()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs
index b92d349665..efec8c70f3 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Dotnet_3597_generated.cs
@@ -72,6 +72,10 @@ static Dotnet_3597()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicDog_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicDog_generated.cs
index e810f891d0..d9a5ab24f6 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicDog_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicDog_generated.cs
@@ -70,6 +70,10 @@ static DynamicDog()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicOwner_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicOwner_generated.cs
index c6678a17cc..fbdd216154 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicOwner_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicOwner_generated.cs
@@ -74,6 +74,10 @@ static DynamicOwner()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubSubTask_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubSubTask_generated.cs
index f7eb811aa1..d9e6dd7c10 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubSubTask_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubSubTask_generated.cs
@@ -70,6 +70,10 @@ static DynamicSubSubTask()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubTask_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubTask_generated.cs
index f09325170e..7d681fe377 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubTask_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicSubTask_generated.cs
@@ -70,6 +70,10 @@ static DynamicSubTask()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicTask_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicTask_generated.cs
index ba8c693ffd..6d9dfd72ba 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicTask_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/DynamicTask_generated.cs
@@ -73,6 +73,10 @@ static DynamicTask()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedAllTypesObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedAllTypesObject_generated.cs
index 8bf6d14cec..c01bde617b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedAllTypesObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedAllTypesObject_generated.cs
@@ -104,6 +104,10 @@ static EmbeddedAllTypesObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedGuidType_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedGuidType_generated.cs
index c96482794d..4776042d5e 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedGuidType_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedGuidType_generated.cs
@@ -83,6 +83,10 @@ static EmbeddedGuidType()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedIntPropertyObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedIntPropertyObject_generated.cs
index 9ebf55a052..48e453b977 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedIntPropertyObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedIntPropertyObject_generated.cs
@@ -70,6 +70,10 @@ static EmbeddedIntPropertyObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel1_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel1_generated.cs
index ef6b33a33d..bd5e377164 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel1_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel1_generated.cs
@@ -72,6 +72,10 @@ static EmbeddedLevel1()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel2_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel2_generated.cs
index dbd5ad8614..1819d83fad 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel2_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel2_generated.cs
@@ -72,6 +72,10 @@ static EmbeddedLevel2()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel3_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel3_generated.cs
index 2a88955ff8..dfc3db9473 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel3_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/EmbeddedLevel3_generated.cs
@@ -70,6 +70,10 @@ static EmbeddedLevel3()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ExplicitClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ExplicitClass_generated.cs
index a3959e1de2..68bb4a5696 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ExplicitClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ExplicitClass_generated.cs
@@ -68,6 +68,10 @@ static ExplicitClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Foo_DuplicateClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Foo_DuplicateClass_generated.cs
index ff6b451658..d72b4b58d0 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Foo_DuplicateClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Foo_DuplicateClass_generated.cs
@@ -70,6 +70,10 @@ static DuplicateClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/GuidType_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/GuidType_generated.cs
index 85a68ed3d6..fcc79144f5 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/GuidType_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/GuidType_generated.cs
@@ -85,6 +85,10 @@ static GuidType()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/HugeSyncObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/HugeSyncObject_generated.cs
index d1a178155e..9a850296ca 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/HugeSyncObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/HugeSyncObject_generated.cs
@@ -71,6 +71,10 @@ static HugeSyncObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedDateTimeOffsetObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedDateTimeOffsetObject_generated.cs
index f8e2730620..371426c660 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedDateTimeOffsetObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedDateTimeOffsetObject_generated.cs
@@ -69,6 +69,10 @@ static IndexedDateTimeOffsetObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedRealmValueObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedRealmValueObject_generated.cs
index c481faabd8..04f9a6c34b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedRealmValueObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexedRealmValueObject_generated.cs
@@ -71,6 +71,10 @@ static IndexedRealmValueObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexesClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexesClass_generated.cs
index 726b13ce26..512583a638 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexesClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IndexesClass_generated.cs
@@ -75,6 +75,10 @@ static IndexesClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InitializedFieldObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InitializedFieldObject_generated.cs
index a3a1d242f0..ececb3c34c 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InitializedFieldObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InitializedFieldObject_generated.cs
@@ -65,6 +65,10 @@ static InitializedFieldObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPrimaryKeyWithValueObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPrimaryKeyWithValueObject_generated.cs
index 73e789d57b..2ae5d0cc83 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPrimaryKeyWithValueObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPrimaryKeyWithValueObject_generated.cs
@@ -71,6 +71,10 @@ static IntPrimaryKeyWithValueObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPropertyObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPropertyObject_generated.cs
index 93c7aa3ad3..b3c3af13f3 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPropertyObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/IntPropertyObject_generated.cs
@@ -73,6 +73,10 @@ static IntPropertyObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InternalObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InternalObject_generated.cs
index 33b75ad9ed..0960c14982 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InternalObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/InternalObject_generated.cs
@@ -69,6 +69,10 @@ static InternalObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level1_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level1_generated.cs
index 347515e7cf..7fd7a0dd95 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level1_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level1_generated.cs
@@ -69,6 +69,10 @@ static Level1()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level2_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level2_generated.cs
index 596789d1c0..f288a08830 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level2_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level2_generated.cs
@@ -69,6 +69,10 @@ static Level2()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level3_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level3_generated.cs
index 4c5754d47c..9c23761757 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level3_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Level3_generated.cs
@@ -68,6 +68,10 @@ static Level3()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LinksObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LinksObject_generated.cs
index 81d6a49945..fcdd337128 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LinksObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LinksObject_generated.cs
@@ -79,6 +79,10 @@ private LinksObject() {}
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ListsObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ListsObject_generated.cs
index d68dc694c7..5129352328 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ListsObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ListsObject_generated.cs
@@ -100,6 +100,10 @@ static ListsObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LoneClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LoneClass_generated.cs
index a5763ad75e..1721486290 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LoneClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/LoneClass_generated.cs
@@ -74,6 +74,10 @@ static LoneClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties1_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties1_generated.cs
index 05a529b9da..77ed774d71 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties1_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties1_generated.cs
@@ -70,6 +70,10 @@ static MixedProperties1()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties2_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties2_generated.cs
index d02d5971a9..25f561aaa3 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties2_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/MixedProperties2_generated.cs
@@ -70,6 +70,10 @@ static MixedProperties2()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NoListProperties_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NoListProperties_generated.cs
index f58473e872..26c5efcf4a 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NoListProperties_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NoListProperties_generated.cs
@@ -68,6 +68,10 @@ static NoListProperties()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyObject_generated.cs
index 5333121b5a..ad33758889 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyObject_generated.cs
@@ -70,6 +70,10 @@ static NonPrimaryKeyObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithNonPKRelation_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithNonPKRelation_generated.cs
index befdc3c597..86b14bb2c2 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithNonPKRelation_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithNonPKRelation_generated.cs
@@ -71,6 +71,10 @@ static NonPrimaryKeyWithNonPKRelation()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithPKRelation_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithPKRelation_generated.cs
index e50235785d..6e2257802f 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithPKRelation_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NonPrimaryKeyWithPKRelation_generated.cs
@@ -71,6 +71,10 @@ static NonPrimaryKeyWithPKRelation()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablePrimaryKeyObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablePrimaryKeyObject_generated.cs
index e5ed955c20..cafbed16da 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablePrimaryKeyObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablePrimaryKeyObject_generated.cs
@@ -71,6 +71,10 @@ static NullablePrimaryKeyObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV0_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV0_generated.cs
index f55e1a2f55..d04b232d4a 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV0_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV0_generated.cs
@@ -81,6 +81,10 @@ static NullablesV0()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV1_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV1_generated.cs
index b23eb0f95d..d935f6c940 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV1_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/NullablesV1_generated.cs
@@ -82,6 +82,10 @@ static NullablesV1()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerEmbedded_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerEmbedded_generated.cs
index d6228f6900..d28590e18d 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerEmbedded_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerEmbedded_generated.cs
@@ -72,6 +72,10 @@ static ObjectContainerEmbedded()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerV1_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerV1_generated.cs
index 7656573817..a71739817c 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerV1_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectContainerV1_generated.cs
@@ -72,6 +72,10 @@ static ObjectContainerV1()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectEmbedded_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectEmbedded_generated.cs
index 11e876025b..ae79d689c0 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectEmbedded_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectEmbedded_generated.cs
@@ -70,6 +70,10 @@ static ObjectEmbedded()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectIdPrimaryKeyWithValueObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectIdPrimaryKeyWithValueObject_generated.cs
index b07baec92d..a4e0697e3b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectIdPrimaryKeyWithValueObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectIdPrimaryKeyWithValueObject_generated.cs
@@ -71,6 +71,10 @@ static ObjectIdPrimaryKeyWithValueObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV1_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV1_generated.cs
index 4e8763e513..3641fd8e4f 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV1_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV1_generated.cs
@@ -71,6 +71,10 @@ static ObjectV1()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV2_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV2_generated.cs
index aaa7305408..1c9f0826b7 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV2_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectV2_generated.cs
@@ -71,6 +71,10 @@ static ObjectV2()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithEmbeddedProperties_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithEmbeddedProperties_generated.cs
index 8b2ebb92c5..16cc0843f1 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithEmbeddedProperties_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithEmbeddedProperties_generated.cs
@@ -74,6 +74,10 @@ static ObjectWithEmbeddedProperties()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithFtsIndex_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithFtsIndex_generated.cs
index 938c952404..3bb1b64d3b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithFtsIndex_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithFtsIndex_generated.cs
@@ -76,6 +76,10 @@ private ObjectWithFtsIndex() {}
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithInvalidGeoPoints_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithInvalidGeoPoints_generated.cs
index a74fa1c834..a134b0a020 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithInvalidGeoPoints_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithInvalidGeoPoints_generated.cs
@@ -74,6 +74,10 @@ static ObjectWithInvalidGeoPoints()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithObjectProperties_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithObjectProperties_generated.cs
index b415e4c459..33f8c98878 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithObjectProperties_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithObjectProperties_generated.cs
@@ -71,6 +71,10 @@ static ObjectWithObjectProperties()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithPartitionValue_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithPartitionValue_generated.cs
index e42f14d20f..e8c6f936c1 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithPartitionValue_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithPartitionValue_generated.cs
@@ -87,6 +87,10 @@ private ObjectWithPartitionValue() {}
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithRequiredStringList_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithRequiredStringList_generated.cs
index b3125f6d45..a50bff1447 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithRequiredStringList_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ObjectWithRequiredStringList_generated.cs
@@ -70,6 +70,10 @@ static ObjectWithRequiredStringList()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnManagedTestClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnManagedTestClass_generated.cs
index 5ee3e39e9e..d9763ad7c4 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnManagedTestClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnManagedTestClass_generated.cs
@@ -74,6 +74,10 @@ static OnManagedTestClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneListProperty_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneListProperty_generated.cs
index c898820c58..c98bbc6df5 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneListProperty_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneListProperty_generated.cs
@@ -67,6 +67,10 @@ static OneListProperty()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneNonListProperty_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneNonListProperty_generated.cs
index 111a1edae4..74143ee5cc 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneNonListProperty_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OneNonListProperty_generated.cs
@@ -67,6 +67,10 @@ static OneNonListProperty()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnlyListProperties_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnlyListProperties_generated.cs
index 18fbf2fb8a..b9a89e2076 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnlyListProperties_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OnlyListProperties_generated.cs
@@ -68,6 +68,10 @@ static OnlyListProperties()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedContainer_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedContainer_generated.cs
index f919824681..82309754a1 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedContainer_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedContainer_generated.cs
@@ -72,6 +72,10 @@ static OrderedContainer()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedObject_generated.cs
index c2d192b787..18a2ef45b5 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/OrderedObject_generated.cs
@@ -72,6 +72,10 @@ static OrderedObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Owner_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Owner_generated.cs
index cafac1bd9a..db516f18c2 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Owner_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Owner_generated.cs
@@ -74,6 +74,10 @@ static Owner()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Parent_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Parent_generated.cs
index 689b69bd90..90de5e529c 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Parent_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Parent_generated.cs
@@ -72,6 +72,10 @@ static Parent()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Person_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Person_generated.cs
index 174a31d421..c4b09c3c59 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Person_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Person_generated.cs
@@ -78,6 +78,10 @@ static Person()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyByteObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyByteObject_generated.cs
index 812b93f044..71e9a35a8c 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyByteObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyByteObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyByteObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyCharObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyCharObject_generated.cs
index 2417aa674f..4c72696814 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyCharObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyCharObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyCharObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyGuidObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyGuidObject_generated.cs
index fe0c026f50..8e7928d9fc 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyGuidObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyGuidObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyGuidObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt16Object_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt16Object_generated.cs
index f1b7f2f79a..8eee64cc15 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt16Object_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt16Object_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyInt16Object()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt32Object_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt32Object_generated.cs
index c24e1ce8ce..b8a629a09b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt32Object_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt32Object_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyInt32Object()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt64Object_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt64Object_generated.cs
index eb8328aaea..e25675acd7 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt64Object_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyInt64Object_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyInt64Object()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableByteObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableByteObject_generated.cs
index 12c3a45229..0bb9215e2b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableByteObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableByteObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyNullableByteObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableCharObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableCharObject_generated.cs
index d26a3cc39b..77a38fc218 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableCharObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableCharObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyNullableCharObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableGuidObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableGuidObject_generated.cs
index 0cb88c6c73..3cc0e75942 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableGuidObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableGuidObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyNullableGuidObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt16Object_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt16Object_generated.cs
index 9f820f65c4..18484d9b4b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt16Object_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt16Object_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyNullableInt16Object()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt32Object_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt32Object_generated.cs
index 976819c208..6289ea3969 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt32Object_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt32Object_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyNullableInt32Object()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt64Object_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt64Object_generated.cs
index ef41d6e5b4..62b0b35a81 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt64Object_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableInt64Object_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyNullableInt64Object()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableObjectIdObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableObjectIdObject_generated.cs
index 279ddd18ac..7bfa9f35b6 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableObjectIdObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyNullableObjectIdObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyNullableObjectIdObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObjectIdObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObjectIdObject_generated.cs
index a58d78148d..475377265c 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObjectIdObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObjectIdObject_generated.cs
@@ -70,6 +70,10 @@ static PrimaryKeyObjectIdObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObject_generated.cs
index e1f5606163..b0b3794d75 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyObject_generated.cs
@@ -71,6 +71,10 @@ static PrimaryKeyObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyStringObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyStringObject_generated.cs
index 8fa84f9328..2fd136611a 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyStringObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyStringObject_generated.cs
@@ -71,6 +71,10 @@ static PrimaryKeyStringObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNoPKList_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNoPKList_generated.cs
index cdc7eeaa3b..5ea4508a74 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNoPKList_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNoPKList_generated.cs
@@ -72,6 +72,10 @@ static PrimaryKeyWithNoPKList()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKChildWithPKGrandChild_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKChildWithPKGrandChild_generated.cs
index aa32eafb43..9c32269e4b 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKChildWithPKGrandChild_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKChildWithPKGrandChild_generated.cs
@@ -72,6 +72,10 @@ static PrimaryKeyWithNonPKChildWithPKGrandChild()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKRelation_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKRelation_generated.cs
index f55be95eb5..7171dcf222 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKRelation_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithNonPKRelation_generated.cs
@@ -72,6 +72,10 @@ static PrimaryKeyWithNonPKRelation()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKList_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKList_generated.cs
index 35e250ac38..5159057161 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKList_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKList_generated.cs
@@ -72,6 +72,10 @@ static PrimaryKeyWithPKList()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKRelation_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKRelation_generated.cs
index b920280aba..f68cfe0542 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKRelation_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrimaryKeyWithPKRelation_generated.cs
@@ -72,6 +72,10 @@ static PrimaryKeyWithPKRelation()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrivatePrimaryKeyObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrivatePrimaryKeyObject_generated.cs
index 0570d73de7..0c6afc9ba3 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrivatePrimaryKeyObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/PrivatePrimaryKeyObject_generated.cs
@@ -71,6 +71,10 @@ static PrivatePrimaryKeyObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Product_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Product_generated.cs
index 9f6c9c20f0..ea045a3b82 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Product_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Product_generated.cs
@@ -70,6 +70,10 @@ static Product()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RealmValueObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RealmValueObject_generated.cs
index e8daefafe5..db8390f80e 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RealmValueObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RealmValueObject_generated.cs
@@ -75,6 +75,10 @@ static RealmValueObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RecursiveBacklinksObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RecursiveBacklinksObject_generated.cs
index 5e41ab41e8..786498690e 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RecursiveBacklinksObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RecursiveBacklinksObject_generated.cs
@@ -72,6 +72,10 @@ static RecursiveBacklinksObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedPropertiesObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedPropertiesObject_generated.cs
index 5e4c36c348..f679860d77 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedPropertiesObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedPropertiesObject_generated.cs
@@ -71,6 +71,10 @@ static RemappedPropertiesObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedTypeObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedTypeObject_generated.cs
index 3a4f16019b..29df5a1bb2 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedTypeObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RemappedTypeObject_generated.cs
@@ -77,6 +77,10 @@ static RemappedTypeObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Report_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Report_generated.cs
index e5ac8925cd..6e0ad9c2f9 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Report_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Report_generated.cs
@@ -70,6 +70,10 @@ static Report()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPrimaryKeyStringObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPrimaryKeyStringObject_generated.cs
index e735bdd674..4a77816cb1 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPrimaryKeyStringObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPrimaryKeyStringObject_generated.cs
@@ -71,6 +71,10 @@ static RequiredPrimaryKeyStringObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPropertyClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPropertyClass_generated.cs
index b73a5c9719..d2351f2a29 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPropertyClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredPropertyClass_generated.cs
@@ -68,6 +68,10 @@ static RequiredPropertyClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredStringObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredStringObject_generated.cs
index 3b2a74276b..f4e2d5833f 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredStringObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/RequiredStringObject_generated.cs
@@ -70,6 +70,10 @@ static RequiredStringObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SerializedObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SerializedObject_generated.cs
index 861b86c81b..466f66a692 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SerializedObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SerializedObject_generated.cs
@@ -76,6 +76,10 @@ static SerializedObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SomeClass_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SomeClass_generated.cs
index 2968e11ccb..bc5a0a0e80 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SomeClass_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SomeClass_generated.cs
@@ -68,6 +68,10 @@ static SomeClass()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncAllTypesObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncAllTypesObject_generated.cs
index 43e759683f..82ad9e6dc2 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncAllTypesObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncAllTypesObject_generated.cs
@@ -88,6 +88,10 @@ static SyncAllTypesObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncCollectionsObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncCollectionsObject_generated.cs
index 1d5fba36f3..b50e742f12 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncCollectionsObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncCollectionsObject_generated.cs
@@ -121,6 +121,10 @@ static SyncCollectionsObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncObjectWithRequiredStringList_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncObjectWithRequiredStringList_generated.cs
index 6a17d53644..1d13ce8cb4 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncObjectWithRequiredStringList_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/SyncObjectWithRequiredStringList_generated.cs
@@ -81,6 +81,10 @@ static SyncObjectWithRequiredStringList()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TestNotificationObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TestNotificationObject_generated.cs
index 9575cfa3dd..d63724084a 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TestNotificationObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TestNotificationObject_generated.cs
@@ -80,6 +80,10 @@ static TestNotificationObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ThrowsBeforeInitializer_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ThrowsBeforeInitializer_generated.cs
index 0694ff19bd..be99c02ddb 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ThrowsBeforeInitializer_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/ThrowsBeforeInitializer_generated.cs
@@ -72,6 +72,10 @@ static ThrowsBeforeInitializer()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TopLevelGeoPoint_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TopLevelGeoPoint_generated.cs
index 5651bed38b..53a60bc84e 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TopLevelGeoPoint_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TopLevelGeoPoint_generated.cs
@@ -73,6 +73,10 @@ static TopLevelGeoPoint()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TypeEmbeddedObject_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TypeEmbeddedObject_generated.cs
index ab38ad749d..93ae3b7cfe 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TypeEmbeddedObject_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/TypeEmbeddedObject_generated.cs
@@ -72,6 +72,10 @@ static TypeEmbeddedObject()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/UnqueryableBacklinks_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/UnqueryableBacklinks_generated.cs
index 52ee731ffb..a7ca6b8f13 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/UnqueryableBacklinks_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/UnqueryableBacklinks_generated.cs
@@ -70,6 +70,10 @@ static UnqueryableBacklinks()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Walker_generated.cs b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Walker_generated.cs
index 9bf650543b..e08d7f1ed3 100644
--- a/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Walker_generated.cs
+++ b/Tests/Realm.Tests/Generated/Realm.SourceGenerator/Realms.SourceGenerator.RealmGenerator/Walker_generated.cs
@@ -73,6 +73,10 @@ static Walker()
[IgnoreDataMember, XmlIgnore]
public Realms.Schema.ObjectSchema ObjectSchema => Accessor.ObjectSchema!;
+ ///
+ [IgnoreDataMember, XmlIgnore]
+ public Realms.Schema.ExtendedObjectSchema ExtendedObjectSchema => Accessor.ExtendedObjectSchema!;
+
///
[IgnoreDataMember, XmlIgnore]
public Realms.DynamicObjectApi DynamicApi => Accessor.DynamicApi;
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 7dc7896847..3d2f842f22 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -234,6 +234,7 @@ extern "C" {
}
object.get_obj().erase_prop(prop_name);
+ return true;
});
}
From 91baa53a9141ef2edfec3a0bdd0a9fd73c7e0b38 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Fri, 19 Jul 2024 10:04:32 +0200
Subject: [PATCH 24/54] Added hasProperty
---
Realm/Realm/Handles/ObjectHandle.cs | 16 ++++++++++++++++
Realm/Realm/Schema/ExtendedObjectSchema.cs | 5 +++++
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 6 ++++++
wrappers/src/object_cs.cpp | 8 ++++++++
4 files changed, 35 insertions(+)
diff --git a/Realm/Realm/Handles/ObjectHandle.cs b/Realm/Realm/Handles/ObjectHandle.cs
index 858749b99f..f3b7fd41b0 100644
--- a/Realm/Realm/Handles/ObjectHandle.cs
+++ b/Realm/Realm/Handles/ObjectHandle.cs
@@ -67,6 +67,9 @@ private static class NativeMethods
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_get_extra_properties", CallingConvention = CallingConvention.Cdecl)]
public static extern MarshaledVector get_extra_properties(ObjectHandle handle, out NativeException ex);
+ [DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_has_property", CallingConvention = CallingConvention.Cdecl)]
+ public static extern bool has_property(ObjectHandle handle, StringValue propertyName, out NativeException ex);
+
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "object_create_embedded", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr create_embedded_link(ObjectHandle handle, IntPtr propertyIndex, out NativeException ex);
@@ -385,6 +388,19 @@ public IEnumerable GetExtraProperties()
return value.ToEnumerable().Select(v => v.ToDotnetString()!);
}
+ internal bool HasProperty(string propertyName)
+ {
+ EnsureIsOpen();
+
+ using Arena arena = new();
+ var propertyNameNative = StringValue.AllocateFrom(propertyName, arena);
+
+ var value = NativeMethods.has_property(this, propertyNameNative, out var nativeException);
+ nativeException.ThrowIfNecessary();
+
+ return value;
+ }
+
public long AddInt64(IntPtr propertyIndex, long value)
{
EnsureIsOpen();
diff --git a/Realm/Realm/Schema/ExtendedObjectSchema.cs b/Realm/Realm/Schema/ExtendedObjectSchema.cs
index 7d78cf0f98..51f7a6af49 100644
--- a/Realm/Realm/Schema/ExtendedObjectSchema.cs
+++ b/Realm/Realm/Schema/ExtendedObjectSchema.cs
@@ -37,5 +37,10 @@ public IEnumerable GetExtraProperties()
{
return _objectHandle.GetExtraProperties();
}
+
+ public bool HasProperty(string propertyName)
+ {
+ return _objectHandle.HasProperty(propertyName);
+ }
}
}
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 84d7b7477e..483a10e3a5 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -999,6 +999,8 @@ public void FlexibleSchema_BaseTest()
//Additional properties should be empty in the beginning
Assert.That(person.ExtendedObjectSchema.GetExtraProperties(), Is.Empty);
+ Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
+
// Basic set/get
realm.Write(() =>
{
@@ -1015,6 +1017,8 @@ public void FlexibleSchema_BaseTest()
Assert.That(person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
Assert.That(person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
+ Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.True);
+
bool found;
found = person.DynamicApi.TryGet("propString", out var stringVal);
@@ -1062,6 +1066,8 @@ public void FlexibleSchema_BaseTest()
person.DynamicApi.Unset("propString");
}), Throws.TypeOf().With.Message.EqualTo("Could not erase property: propString"));
+ Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
+
// Unset property in schema
Assert.That(() => realm.Write(() =>
{
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index 3d2f842f22..ea2786cf80 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -238,6 +238,14 @@ extern "C" {
});
}
+ REALM_EXPORT bool object_has_property(Object& object, realm_string_t property_name,
+ NativeException::Marshallable& ex)
+ {
+ return handle_errors(ex, [&]() {
+ return object.get_obj().has_property(capi_to_std(property_name));
+ });
+ }
+
//realm_string_collection_t is equivalent to MarshaledVector but that cannot be used
//TODO need to see if we can do this differently
REALM_EXPORT realm_string_collection_t object_get_extra_properties(Object& object, NativeException::Marshallable& ex)
From 580f5869b6cc6d2186fd83cb61e8a2e8d66652a8 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Fri, 19 Jul 2024 10:15:17 +0200
Subject: [PATCH 25/54] Corrected extra property
---
Realm/Realm/Schema/ExtendedObjectSchema.cs | 8 ++++----
Tests/Realm.Tests/Database/DynamicAccessTests.cs | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Realm/Realm/Schema/ExtendedObjectSchema.cs b/Realm/Realm/Schema/ExtendedObjectSchema.cs
index 51f7a6af49..2c09b71d5e 100644
--- a/Realm/Realm/Schema/ExtendedObjectSchema.cs
+++ b/Realm/Realm/Schema/ExtendedObjectSchema.cs
@@ -18,6 +18,7 @@
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using Realms.Native;
namespace Realms.Schema
@@ -33,10 +34,9 @@ internal ExtendedObjectSchema(ObjectSchema schema, ObjectHandle objectHandle)
_objectHandle = objectHandle;
}
- public IEnumerable GetExtraProperties()
- {
- return _objectHandle.GetExtraProperties();
- }
+ public IEnumerable ExtraProperties =>
+ _objectHandle.GetExtraProperties()
+ .Select(name => new Property(name, PropertyType.RealmValue));
public bool HasProperty(string propertyName)
{
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index 483a10e3a5..bd827fbaa0 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -997,7 +997,7 @@ public void FlexibleSchema_BaseTest()
var testList = new List { 1, "test", true };
//Additional properties should be empty in the beginning
- Assert.That(person.ExtendedObjectSchema.GetExtraProperties(), Is.Empty);
+ Assert.That(person.ExtendedObjectSchema.ExtraProperties, Is.Empty);
Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
@@ -1098,7 +1098,7 @@ public void FlexibleSchema_BaseTest()
//});
// Get all extra properties keys
- Assert.That(person.ExtendedObjectSchema.GetExtraProperties(), Is.EquivalentTo(new[] { "propObj", "propList", "propNull" }));
+ Assert.That(person.ExtendedObjectSchema.ExtraProperties.Select(p => p.Name), Is.EquivalentTo(new[] { "propObj", "propList", "propNull" }));
}
#endregion
From b65caee3a48dbf2256210928e25ff7425e1fecfb Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Fri, 19 Jul 2024 12:17:17 +0200
Subject: [PATCH 26/54] Moved tests to new file
---
.../Database/DynamicAccessTests.cs | 123 --------------
.../Database/RelaxedSchemaTests.cs | 156 ++++++++++++++++++
2 files changed, 156 insertions(+), 123 deletions(-)
create mode 100644 Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
diff --git a/Tests/Realm.Tests/Database/DynamicAccessTests.cs b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
index bd827fbaa0..51c7fb9cc7 100644
--- a/Tests/Realm.Tests/Database/DynamicAccessTests.cs
+++ b/Tests/Realm.Tests/Database/DynamicAccessTests.cs
@@ -980,129 +980,6 @@ public void GetDictionary_WhenCastToWrongValue_Throws()
#endregion
- #region Flexible schema
-
- [Test]
- public void FlexibleSchema_BaseTest()
- {
- _configuration.RelaxedSchema = true;
- var realm = GetRealm(_configuration);
-
- var person = realm.Write(() =>
- {
- return realm.Add(new Person());
- });
-
- var testObj = new Person { FirstName = "Luigi" };
- var testList = new List { 1, "test", true };
-
- //Additional properties should be empty in the beginning
- Assert.That(person.ExtendedObjectSchema.ExtraProperties, Is.Empty);
-
- Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
-
- // Basic set/get
- realm.Write(() =>
- {
- person.DynamicApi.Set("propString", "testval");
- person.DynamicApi.Set("propInt", 10);
- person.DynamicApi.Set("propObj", testObj);
- person.DynamicApi.Set("propList", testList);
- person.DynamicApi.Set("propNull", RealmValue.Null);
- });
-
- Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
- Assert.That(person.DynamicApi.Get("propInt"), Is.EqualTo(10));
- Assert.That(person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
- Assert.That(person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
- Assert.That(person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
-
- Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.True);
-
- bool found;
-
- found = person.DynamicApi.TryGet("propString", out var stringVal);
- Assert.That(found, Is.True);
- Assert.That(stringVal, Is.EqualTo("testval"));
-
- found = person.DynamicApi.TryGet>("propList", out var listVal);
- Assert.That(found, Is.True);
- Assert.That(listVal, Is.EqualTo(testList));
-
- // Change type
- realm.Write(() =>
- {
- person.DynamicApi.Set("propString", 23);
- });
-
- Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo(23));
-
- // Get unknown property
- Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
- Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
-
- // TryGet unknown property
- found = person.DynamicApi.TryGet("unknonProp", out var rvUnKnownValue);
- Assert.That(found, Is.False);
- Assert.That(rvUnKnownValue, Is.EqualTo(RealmValue.Null));
-
- found = person.DynamicApi.TryGet("unknonProp", out var intUnknownVal);
- Assert.That(found, Is.False);
- Assert.That(intUnknownVal, Is.EqualTo(default(int)));
-
- found = person.DynamicApi.TryGet>("unknonProp", out var listUnknonwVal);
- Assert.That(found, Is.False);
- Assert.That(listUnknonwVal, Is.EqualTo(default(IList)));
-
- // Unset property
- realm.Write(() =>
- {
- person.DynamicApi.Unset("propString");
- });
- Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
-
- Assert.That(() => realm.Write(() =>
- {
- person.DynamicApi.Unset("propString");
- }), Throws.TypeOf().With.Message.EqualTo("Could not erase property: propString"));
-
- Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
-
- // Unset property in schema
- Assert.That(() => realm.Write(() =>
- {
- person.DynamicApi.Unset("FirstName");
- }), Throws.TypeOf().With.Message.EqualTo("Could not erase property: FirstName"));
-
- // TryUnset property
- realm.Write(() =>
- {
- bool unsetVal = person.DynamicApi.TryUnset("propInt");
- Assert.That(unsetVal, Is.True);
- });
- Assert.That(() => person.DynamicApi.Get("propInt"), Throws.TypeOf().With.Message.EqualTo("Property not found: propInt"));
-
- realm.Write(() =>
- {
- bool unsetVal = person.DynamicApi.TryUnset("propInt");
- Assert.That(unsetVal, Is.False);
- });
-
- // TryUnset property in schema
- // We need to get a new core method to check if a certain property is in the extra
- // properties
- //realm.Write(() =>
- //{
- // bool unsetVal = person.DynamicApi.TryUnset("FirstName");
- // Assert.That(unsetVal, Is.False);
- //});
-
- // Get all extra properties keys
- Assert.That(person.ExtendedObjectSchema.ExtraProperties.Select(p => p.Name), Is.EquivalentTo(new[] { "propObj", "propList", "propNull" }));
- }
-
- #endregion
-
[Test]
public void GetPrimaryKey_WhenPrivate_Works()
{
diff --git a/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs b/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
new file mode 100644
index 0000000000..f05b24c92a
--- /dev/null
+++ b/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
@@ -0,0 +1,156 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2023 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License")
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using NUnit.Framework;
+
+namespace Realms.Tests.Database
+{
+ [TestFixture]
+ [Preserve(AllMembers = true)]
+ public class RelaxedSchemaTests : RealmInstanceTest
+ {
+ protected override RealmConfiguration CreateConfiguration(string path)
+ {
+ var newConfig = base.CreateConfiguration(path);
+ newConfig.RelaxedSchema = true;
+ return newConfig;
+ }
+
+ [Test]
+ public void FlexibleSchema_BaseTest()
+ {
+ var person = _realm.Write(() =>
+ {
+ return _realm.Add(new Person());
+ });
+
+ var testObj = new Person { FirstName = "Luigi" };
+ var testList = new List { 1, "test", true };
+
+ //Additional properties should be empty in the beginning
+ Assert.That(person.ExtendedObjectSchema.ExtraProperties, Is.Empty);
+
+ Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
+
+ // Basic set/get
+ _realm.Write(() =>
+ {
+ person.DynamicApi.Set("propString", "testval");
+ person.DynamicApi.Set("propInt", 10);
+ person.DynamicApi.Set("propObj", testObj);
+ person.DynamicApi.Set("propList", testList);
+ person.DynamicApi.Set("propNull", RealmValue.Null);
+ });
+
+ Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
+ Assert.That(person.DynamicApi.Get("propInt"), Is.EqualTo(10));
+ Assert.That(person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
+ Assert.That(person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
+ Assert.That(person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
+
+ Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.True);
+
+ bool found;
+
+ found = person.DynamicApi.TryGet("propString", out var stringVal);
+ Assert.That(found, Is.True);
+ Assert.That(stringVal, Is.EqualTo("testval"));
+
+ found = person.DynamicApi.TryGet>("propList", out var listVal);
+ Assert.That(found, Is.True);
+ Assert.That(listVal, Is.EqualTo(testList));
+
+ // Change type
+ _realm.Write(() =>
+ {
+ person.DynamicApi.Set("propString", 23);
+ });
+
+ Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo(23));
+
+ // Get unknown property
+ Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+
+ // TryGet unknown property
+ found = person.DynamicApi.TryGet("unknonProp", out var rvUnKnownValue);
+ Assert.That(found, Is.False);
+ Assert.That(rvUnKnownValue, Is.EqualTo(RealmValue.Null));
+
+ found = person.DynamicApi.TryGet("unknonProp", out var intUnknownVal);
+ Assert.That(found, Is.False);
+ Assert.That(intUnknownVal, Is.EqualTo(default(int)));
+
+ found = person.DynamicApi.TryGet>("unknonProp", out var listUnknonwVal);
+ Assert.That(found, Is.False);
+ Assert.That(listUnknonwVal, Is.EqualTo(default(IList)));
+
+ // Unset property
+ _realm.Write(() =>
+ {
+ person.DynamicApi.Unset("propString");
+ });
+ Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
+
+ Assert.That(() => _realm.Write(() =>
+ {
+ person.DynamicApi.Unset("propString");
+ }), Throws.TypeOf().With.Message.EqualTo("Could not erase property: propString"));
+
+ Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
+
+ // Unset property in schema
+ Assert.That(() => _realm.Write(() =>
+ {
+ person.DynamicApi.Unset("FirstName");
+ }), Throws.TypeOf().With.Message.EqualTo("Could not erase property: FirstName"));
+
+ // TryUnset property
+ _realm.Write(() =>
+ {
+ bool unsetVal = person.DynamicApi.TryUnset("propInt");
+ Assert.That(unsetVal, Is.True);
+ });
+ Assert.That(() => person.DynamicApi.Get("propInt"), Throws.TypeOf().With.Message.EqualTo("Property not found: propInt"));
+
+ _realm.Write(() =>
+ {
+ bool unsetVal = person.DynamicApi.TryUnset("propInt");
+ Assert.That(unsetVal, Is.False);
+ });
+
+ // TryUnset property in schema
+ // We need to get a new core method to check if a certain property is in the extra
+ // properties
+ //realm.Write(() =>
+ //{
+ // bool unsetVal = person.DynamicApi.TryUnset("FirstName");
+ // Assert.That(unsetVal, Is.False);
+ //});
+
+ // Get all extra properties keys
+ Assert.That(person.ExtendedObjectSchema.ExtraProperties.Select(p => p.Name), Is.EquivalentTo(new[] { "propObj", "propList", "propNull" }));
+ }
+
+ }
+}
From 2f341e3481ae644b557229987aa08ff47c306ce8 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 22 Jul 2024 10:09:46 +0200
Subject: [PATCH 27/54] Added dictionary paths
---
.../Database/RelaxedSchemaTests.cs | 103 ++++++++++++------
wrappers/src/object_cs.cpp | 17 +--
2 files changed, 77 insertions(+), 43 deletions(-)
diff --git a/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs b/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
index f05b24c92a..87718031c8 100644
--- a/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
+++ b/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
@@ -19,8 +19,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using NUnit.Framework;
namespace Realms.Tests.Database
@@ -29,6 +27,8 @@ namespace Realms.Tests.Database
[Preserve(AllMembers = true)]
public class RelaxedSchemaTests : RealmInstanceTest
{
+ private Person _person = null!;
+
protected override RealmConfiguration CreateConfiguration(string path)
{
var newConfig = base.CreateConfiguration(path);
@@ -36,106 +36,137 @@ protected override RealmConfiguration CreateConfiguration(string path)
return newConfig;
}
- [Test]
- public void FlexibleSchema_BaseTest()
+ protected override void CustomSetUp()
{
- var person = _realm.Write(() =>
+ base.CustomSetUp();
+ _person = _realm.Write(() =>
{
return _realm.Add(new Person());
});
+ }
+
+ [Test]
+ public void GetSet_Basic()
+ {
+ var testObj = new Person { FirstName = "Luigi" };
+ var testList = new List { 1, "test", true };
+ var testDict = new Dictionary { { "t1", true }, { "t2", "string" } };
+
+ // Basic set/get
+ _realm.Write(() =>
+ {
+ _person.DynamicApi.Set("propString", "testval");
+ _person.DynamicApi.Set("propInt", 10);
+ _person.DynamicApi.Set("propObj", testObj);
+ _person.DynamicApi.Set("propList", testList);
+ _person.DynamicApi.Set("propDict", testDict);
+ _person.DynamicApi.Set("propNull", RealmValue.Null);
+ });
+
+ Assert.That(_person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
+ Assert.That(_person.DynamicApi.Get("propInt"), Is.EqualTo(10));
+ Assert.That(_person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
+ Assert.That(_person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
+ Assert.That(_person.DynamicApi.Get>("propDict"), Is.EqualTo(testDict));
+ Assert.That(_person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
+ }
+
+ [Test]
+ public void FlexibleSchema_BaseTest()
+ {
var testObj = new Person { FirstName = "Luigi" };
var testList = new List { 1, "test", true };
//Additional properties should be empty in the beginning
- Assert.That(person.ExtendedObjectSchema.ExtraProperties, Is.Empty);
+ Assert.That(_person.ExtendedObjectSchema.ExtraProperties, Is.Empty);
- Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
+ Assert.That(_person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
// Basic set/get
_realm.Write(() =>
{
- person.DynamicApi.Set("propString", "testval");
- person.DynamicApi.Set("propInt", 10);
- person.DynamicApi.Set("propObj", testObj);
- person.DynamicApi.Set("propList", testList);
- person.DynamicApi.Set("propNull", RealmValue.Null);
+ _person.DynamicApi.Set("propString", "testval");
+ _person.DynamicApi.Set("propInt", 10);
+ _person.DynamicApi.Set("propObj", testObj);
+ _person.DynamicApi.Set("propList", testList);
+ _person.DynamicApi.Set("propNull", RealmValue.Null);
});
- Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
- Assert.That(person.DynamicApi.Get("propInt"), Is.EqualTo(10));
- Assert.That(person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
- Assert.That(person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
- Assert.That(person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
+ Assert.That(_person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
+ Assert.That(_person.DynamicApi.Get("propInt"), Is.EqualTo(10));
+ Assert.That(_person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
+ Assert.That(_person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
+ Assert.That(_person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
- Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.True);
+ Assert.That(_person.ExtendedObjectSchema.HasProperty("propString"), Is.True);
bool found;
- found = person.DynamicApi.TryGet("propString", out var stringVal);
+ found = _person.DynamicApi.TryGet("propString", out var stringVal);
Assert.That(found, Is.True);
Assert.That(stringVal, Is.EqualTo("testval"));
- found = person.DynamicApi.TryGet>("propList", out var listVal);
+ found = _person.DynamicApi.TryGet>("propList", out var listVal);
Assert.That(found, Is.True);
Assert.That(listVal, Is.EqualTo(testList));
// Change type
_realm.Write(() =>
{
- person.DynamicApi.Set("propString", 23);
+ _person.DynamicApi.Set("propString", 23);
});
- Assert.That(person.DynamicApi.Get("propString"), Is.EqualTo(23));
+ Assert.That(_person.DynamicApi.Get("propString"), Is.EqualTo(23));
// Get unknown property
- Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
- Assert.That(() => person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ Assert.That(() => _person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ Assert.That(() => _person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
// TryGet unknown property
- found = person.DynamicApi.TryGet("unknonProp", out var rvUnKnownValue);
+ found = _person.DynamicApi.TryGet("unknonProp", out var rvUnKnownValue);
Assert.That(found, Is.False);
Assert.That(rvUnKnownValue, Is.EqualTo(RealmValue.Null));
- found = person.DynamicApi.TryGet("unknonProp", out var intUnknownVal);
+ found = _person.DynamicApi.TryGet("unknonProp", out var intUnknownVal);
Assert.That(found, Is.False);
Assert.That(intUnknownVal, Is.EqualTo(default(int)));
- found = person.DynamicApi.TryGet>("unknonProp", out var listUnknonwVal);
+ found = _person.DynamicApi.TryGet>("unknonProp", out var listUnknonwVal);
Assert.That(found, Is.False);
Assert.That(listUnknonwVal, Is.EqualTo(default(IList)));
// Unset property
_realm.Write(() =>
{
- person.DynamicApi.Unset("propString");
+ _person.DynamicApi.Unset("propString");
});
- Assert.That(() => person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
+ Assert.That(() => _person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
Assert.That(() => _realm.Write(() =>
{
- person.DynamicApi.Unset("propString");
+ _person.DynamicApi.Unset("propString");
}), Throws.TypeOf().With.Message.EqualTo("Could not erase property: propString"));
- Assert.That(person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
+ Assert.That(_person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
// Unset property in schema
Assert.That(() => _realm.Write(() =>
{
- person.DynamicApi.Unset("FirstName");
+ _person.DynamicApi.Unset("FirstName");
}), Throws.TypeOf().With.Message.EqualTo("Could not erase property: FirstName"));
// TryUnset property
_realm.Write(() =>
{
- bool unsetVal = person.DynamicApi.TryUnset("propInt");
+ bool unsetVal = _person.DynamicApi.TryUnset("propInt");
Assert.That(unsetVal, Is.True);
});
- Assert.That(() => person.DynamicApi.Get("propInt"), Throws.TypeOf().With.Message.EqualTo("Property not found: propInt"));
+ Assert.That(() => _person.DynamicApi.Get("propInt"), Throws.TypeOf().With.Message.EqualTo("Property not found: propInt"));
_realm.Write(() =>
{
- bool unsetVal = person.DynamicApi.TryUnset("propInt");
+ bool unsetVal = _person.DynamicApi.TryUnset("propInt");
Assert.That(unsetVal, Is.False);
});
@@ -149,7 +180,7 @@ public void FlexibleSchema_BaseTest()
//});
// Get all extra properties keys
- Assert.That(person.ExtendedObjectSchema.ExtraProperties.Select(p => p.Name), Is.EquivalentTo(new[] { "propObj", "propList", "propNull" }));
+ Assert.That(_person.ExtendedObjectSchema.ExtraProperties.Select(p => p.Name), Is.EquivalentTo(new[] { "propObj", "propList", "propNull" }));
}
}
diff --git a/wrappers/src/object_cs.cpp b/wrappers/src/object_cs.cpp
index ea2786cf80..a475f5fcd8 100644
--- a/wrappers/src/object_cs.cpp
+++ b/wrappers/src/object_cs.cpp
@@ -157,6 +157,9 @@ extern "C" {
case type_List:
*value = to_capi(new List(object.realm(), object.get_obj().get_list_ptr(prop_name)));
break;
+ case type_Dictionary:
+ *value = to_capi(new object_store::Dictionary(object.realm(), object.get_obj().get_dictionary_ptr(prop_name)));
+ break;
default:
*value = to_capi(std::move(val));
break;
@@ -299,24 +302,24 @@ extern "C" {
return handle_errors(ex, [&]()-> void* {
verify_can_set(object);
- auto prop = capi_to_std(property_name);
-
- Path path = { PathElement(prop) };
+ auto prop_name = capi_to_std(property_name);
switch (type)
{
case realm::binding::realm_value_type::RLM_TYPE_LIST:
{
- object.get_obj().set_collection(prop, CollectionType::List);
- //TODO We probably need to ask for methods that do not require to build a path
- auto innerList = new List(object.realm(), object.get_obj().get_list_ptr(path));
+ object.get_obj().set_collection(prop_name, CollectionType::List);
+ auto innerList = new List(object.realm(), object.get_obj().get_list_ptr(prop_name));
innerList->remove_all();
return innerList;
}
case realm::binding::realm_value_type::RLM_TYPE_DICTIONARY:
{
- REALM_TERMINATE("Invalid collection type");
+ object.get_obj().set_collection(prop_name, CollectionType::Dictionary);
+ auto innerDict = new object_store::Dictionary(object.realm(), object.get_obj().get_dictionary_ptr(prop_name));
+ innerDict->remove_all();
+ return innerDict;
}
default:
REALM_TERMINATE("Invalid collection type");
From 8af7de188ee668f3b698ec3e605e6214131357f6 Mon Sep 17 00:00:00 2001
From: Ferdinando Papale <4850119+papafe@users.noreply.github.com>
Date: Mon, 22 Jul 2024 10:43:36 +0200
Subject: [PATCH 28/54] Added tests [skip-ci]
---
.../Database/RelaxedSchemaTests.cs | 188 +++++++++++++-----
1 file changed, 136 insertions(+), 52 deletions(-)
diff --git a/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs b/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
index 87718031c8..038811a5a1 100644
--- a/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
+++ b/Tests/Realm.Tests/Database/RelaxedSchemaTests.cs
@@ -52,7 +52,6 @@ public void GetSet_Basic()
var testList = new List { 1, "test", true };
var testDict = new Dictionary { { "t1", true }, { "t2", "string" } };
- // Basic set/get
_realm.Write(() =>
{
_person.DynamicApi.Set("propString", "testval");
@@ -69,38 +68,47 @@ public void GetSet_Basic()
Assert.That(_person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
Assert.That(_person.DynamicApi.Get>("propDict"), Is.EqualTo(testDict));
Assert.That(_person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
+
+ Assert.That(_person.DynamicApi.Get("propString").As(), Is.EqualTo("testval"));
+ Assert.That(_person.DynamicApi.Get("propInt").As(), Is.EqualTo(10));
+ Assert.That(_person.DynamicApi.Get("propObj").As, Is.EqualTo(testObj));
+ Assert.That(_person.DynamicApi.Get("propList").As>, Is.EqualTo(testList));
+ Assert.That(_person.DynamicApi.Get("propDict").As>(), Is.EqualTo(testDict));
+ Assert.That(_person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
}
+ [Test]
+ public void Get_OnMissingProperty_Throws()
+ {
+ Assert.That(() => _person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ Assert.That(() => _person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ }
[Test]
- public void FlexibleSchema_BaseTest()
+ public void TryGet_OnMissingProperty_ReturnsFalse()
{
- var testObj = new Person { FirstName = "Luigi" };
- var testList = new List { 1, "test", true };
+ bool found;
- //Additional properties should be empty in the beginning
- Assert.That(_person.ExtendedObjectSchema.ExtraProperties, Is.Empty);
+ found = _person.DynamicApi.TryGet("unknonProp", out var rvUnKnownValue);
+ Assert.That(found, Is.False);
+ Assert.That(rvUnKnownValue, Is.EqualTo(RealmValue.Null));
- Assert.That(_person.ExtendedObjectSchema.HasProperty("propString"), Is.False);
+ found = _person.DynamicApi.TryGet("unknonProp", out var intUnknownVal);
+ Assert.That(found, Is.False);
+ Assert.That(intUnknownVal, Is.EqualTo(default(int)));
+ }
+
+ [Test]
+ public void TryGet_OnExistingProperty_ReturnsTrue()
+ {
+ var testList = new List { 1, "test", true };
- // Basic set/get
_realm.Write(() =>
{
_person.DynamicApi.Set("propString", "testval");
- _person.DynamicApi.Set("propInt", 10);
- _person.DynamicApi.Set("propObj", testObj);
_person.DynamicApi.Set("propList", testList);
- _person.DynamicApi.Set("propNull", RealmValue.Null);
});
- Assert.That(_person.DynamicApi.Get("propString"), Is.EqualTo("testval"));
- Assert.That(_person.DynamicApi.Get("propInt"), Is.EqualTo(10));
- Assert.That(_person.DynamicApi.Get("propObj"), Is.EqualTo(testObj));
- Assert.That(_person.DynamicApi.Get>("propList"), Is.EqualTo(testList));
- Assert.That(_person.DynamicApi.Get("propNull"), Is.EqualTo(RealmValue.Null));
-
- Assert.That(_person.ExtendedObjectSchema.HasProperty("propString"), Is.True);
-
bool found;
found = _person.DynamicApi.TryGet("propString", out var stringVal);
@@ -111,65 +119,134 @@ public void FlexibleSchema_BaseTest()
Assert.That(found, Is.True);
Assert.That(listVal, Is.EqualTo(testList));
- // Change type
+ found = _person.DynamicApi.TryGet>("unknonProp", out var listUnknonwVal);
+ Assert.That(found, Is.False);
+ Assert.That(listUnknonwVal, Is.EqualTo(default(IList)));
+ }
+
+ [Test]
+ public void Set_OnSameProperty_WorksWithSameType()
+ {
_realm.Write(() =>
{
- _person.DynamicApi.Set("propString", 23);
+ _person.DynamicApi.Set("prop", "testval");
});
+ Assert.That(_person.DynamicApi.Get("prop"), Is.EqualTo("testval"));
- Assert.That(_person.DynamicApi.Get("propString"), Is.EqualTo(23));
+ _realm.Write(() =>
+ {
+ _person.DynamicApi.Set("prop", "testval2");
+ });
+ Assert.That(_person.DynamicApi.Get("prop"), Is.EqualTo("testval2"));
+ }
- // Get unknown property
- Assert.That(() => _person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
- Assert.That(() => _person.DynamicApi.Get("unknonProp"), Throws.TypeOf().With.Message.EqualTo("Property not found: unknonProp"));
+ [Test]
+ public void Set_OnSameProperty_WorksWithDifferentType()
+ {
+ _realm.Write(() =>
+ {
+ _person.DynamicApi.Set("prop", "testval");
+ });
+ Assert.That(_person.DynamicApi.Get("prop"), Is.EqualTo("testval"));
- // TryGet unknown property
- found = _person.DynamicApi.TryGet("unknonProp", out var rvUnKnownValue);
- Assert.That(found, Is.False);
- Assert.That(rvUnKnownValue, Is.EqualTo(RealmValue.Null));
+ _realm.Write(() =>
+ {
+ _person.DynamicApi.Set("prop", 23);
+ });
+ Assert.That(_person.DynamicApi.Get("prop"), Is.EqualTo(23));
- found = _person.DynamicApi.TryGet("unknonProp", out var intUnknownVal);
- Assert.That(found, Is.False);
- Assert.That(intUnknownVal, Is.EqualTo(default(int)));
+ var testList = new List { 1, "test", true };
- found = _person.DynamicApi.TryGet>("unknonProp", out var listUnknonwVal);
- Assert.That(found, Is.False);
- Assert.That(listUnknonwVal, Is.EqualTo(default(IList)));
+ _realm.Write(() =>
+ {
+ _person.DynamicApi.Set("prop", testList);
+ });
+ Assert.That(_person.DynamicApi.Get>("prop"), Is.EqualTo(testList));
+ }
+
+ [Test]
+ public void Set_OnSameProperty_WorksWithCollectionOfSameType()
+ {
+ var testList1 = new List { 1, "test", true };
+ var testList2 = new List { false, 50, "st" };
- // Unset property
_realm.Write(() =>
{
- _person.DynamicApi.Unset("propString");
+ _person.DynamicApi.Set("prop", testList1);
});
- Assert.That(() => _person.DynamicApi.Get("propString"), Throws.TypeOf().With.Message.EqualTo("Property not found: propString"));
+ Assert.That(_person.DynamicApi.Get>("prop"), Is.EqualTo(testList1));
- Assert.That(() => _realm.Write(() =>
+ _realm.Write(() =>
+ {
+ _person.DynamicApi.Set("prop", testList2);
+ });
+ Assert.That(_person.DynamicApi.Get>("prop"), Is.EqualTo(testList2));
+ }
+
+ [Test]
+ public void Unset_OnExtraProperty_RemovesProperty()
+ {
+ _realm.Write(() =>
+ {
+ _person.DynamicApi.Set("prop", "testval");
+ });
+ Assert.That(_person.DynamicApi.Get("prop"), Is.EqualTo("testval"));
+
+ _realm.Write(() =>
{
- _person.DynamicApi.Unset("propString");
- }), Throws.TypeOf