0.80.0 - Overhaul of Realm.Manage
0.80.0 (2016-10-27)
Breaking Changes
- This version updates the file format. Older versions will not be able to open files created with this version. (#846)
RealmList<T>
is now marked as internal. If you were using it anywhere, you should migrate toIList<T>
. (#880)
Enhancements
-
iOS Linking all should work - we now add a [Preserve] attribute to all woven members of your
RealmObject
subclasses so you do not need to manually add[Preserve(allMembers=true)]
(#822) -
Realm.Manage
calls are now much faster. You should prefer that toRealm.CreateObject
unless you are setting only a few properties, while leaving the rest with default values. (#857) -
Added
bool update
argument toRealm.Manage
. Whenupdate: true
is passed, Realm will try to find and update a persisted object with the same PrimaryKey. If an object with the same PrimaryKey is not found, the umnamaged object is added. If the passed in object does not have a PrimaryKey, it will be added. Any related objects will be added or updated depending on whether they have PrimaryKeys. (#871)NOTE: cyclic relationships, where object references are not identical, will not be reconciled. E.g. this will work as expected:
var person = new Person { Name = "Peter", Id = 1 }; person.Dog = new Dog(); person.Dog.Owner = person;
However this will not - it will set the Person's properties to the ones from the last instance it sees:
var person = new Person { Name = "Peter", Id = 1 }; person.Dog = new Dog(); person.Dog.Owner = new Person { Id = 1 };
This is important when deserializing data from json, where you may have multiple instances of object with the same Id, but with different properties.
-
Realm.Manage
will no longer throw an exception if a managed object is passed. Instead, it will immediately return. (#871) -
Added non-generic version of
Realm.Manage
. (#871) -
Added support for nullable integer PrimaryKeys. Now you can have
long?
PrimaryKey property wherenull
is a valid unique value. (#877) -
Added a weaver warning when applying Realm attributes (e.g.
[Indexed]
or[PrimaryKey]
) on non-persisted properties. (#882) -
Added support for
==
and!=
comparisons to realm objects in LINQ (#896), e.g.:
csharp var peter = realm.All<Person>().FirstOrDefault(d => d.Name == "Peter"); var petersDogs = realm.All<Dog>().Where(d => d.Owner == peter);
-
Added support for
StartsWith(string, StringComparison)
,EndsWith(string, StringComparison)
, andEquals(string, StringComparison)
filtering in LINQ. (#893)NOTE: Currently only
Ordinal
andOrdinalIgnoreCase
comparisons are supported. Trying to pass in a different one will result in runtime error. If no argument is supplied,Ordinal
will be used.