// TODO make not generic protected void SetObjectValue <T>(string propertyName, T value) where T : RealmObject { Debug.Assert(_realm != null, "Object is not managed, but managed access was attempted"); if (!_realm.IsInTransaction) { throw new RealmOutsideTransactionException("Cannot set values outside transaction"); } var rowIndex = _rowHandle.RowIndex; if (value == null) { NativeTable.clear_link(_metadata.Table, _metadata.ColumnIndices[propertyName], (IntPtr)rowIndex); } else { if (!value.IsManaged) { _realm.Manage(value); } NativeTable.set_link(_metadata.Table, _metadata.ColumnIndices[propertyName], (IntPtr)rowIndex, (IntPtr)value.RowHandle.RowIndex); } }