Questions tagged [realm-net]

This tag is for content related to the .NET/Xamarin version of Realm.io (the portable database engine).

Realm Xamarin is easy to work with, and makes your apps speedier. This should go without saying, but Realm Xamarin obviously allows you to write your app once in C♯ and target both iOS & Android (with more platforms to follow). Get started with an almost zero-configuration setup, and you're on your way. Objects in Realm work just like regular objects, so you already know how to use them. The real Realm magic comes when you need simple migrations or change notifications or built-in encryption.

13 questions
6
votes
1 answer

realm.xamarin throws error: The method 'Contains' is not supported. same for 'Any'

i am writing a query which required 'WHERE IN' like clause in realm.xamarin linq query. below is the query i tried: var IdsToMatch = observations.Select(x => x.Id) var results = from d in realm.All() where IdsToMatch.Any(p => p ==…
RohitWagh
  • 1,999
  • 3
  • 22
  • 43
5
votes
2 answers

How to implement Nullable properties in Realm objects (DateTime more exactly)?

The question is really simple, about how to workaround this error: Fody/RealmWeaver: class 'X' field 'Y' is a 'System.Nullable`1' which is not yet supported. This is for a DateTime? property. Nullable primitive types are indeed supported. I know…
Marcel N.
  • 13,726
  • 5
  • 47
  • 72
2
votes
2 answers

Crash when deleting a realm object bound to a ListView

I have a Xamarin XAML page with a ListView. The list data source is linked to an observable collection which is populated with realm objects. When i try to delete an object from the ListView (first from the data source and then from realm) I've got…
Trasnea Daniel
  • 307
  • 2
  • 12
2
votes
2 answers

How to check for null on Nullable types using Linq expression in Realm?

I want to get all elements where the Modified property isn't set but can't seem to get it to work with Realm. Sample Code: public class FooModel : RealmObject { public DateTimeOffset? Modified { get; set; } } ... public List
Marc
  • 21
  • 4
2
votes
2 answers

Realm dotnet: get element by index from RealmResults

I'm implementing android RecycleView using Xamarin and Realm as database. RecycleView requires access to datasource by index. Is there any way to retrieve element by index from RealmResults? I've found that it is possible in realm java just by…
Semyon
  • 528
  • 5
  • 16
2
votes
2 answers

Simple migrations in Realm for Xamarin

The documentation of Realm for Xamarin says: Realm will automatically perform migrations that can be done without processing, like adding and removing classes or adding and removing properties from a class. For more complex changes, a proper…
Reynaldo Aguilar
  • 1,906
  • 1
  • 15
  • 29
2
votes
1 answer

String Length attribute in Realm for Xamarin C#

In EF its StringLength and in SQLite.net its MaxLength but I cannot seem to figure out if there is an attribute for setting the Expected String Length in Realm. Anyone know what it is?
J3RM
  • 1,702
  • 12
  • 17
1
vote
3 answers

Xamarin realm autoincrement

I'm trying to change from SQLite to Realm.io in my Xamarin projects, but can't find any autoincrement on ID's. I found a post with Java, with following line: int nextID = (int) (realm.where(dbObj.class).maximumInt("id") + 1); In Xamarin there isn't…
1
vote
1 answer

Is there a way to generate a Realm.io database from a Windows server?

I would like to generate a Realm.io database from a windows server. My aim is to download it (through web services) and read it from a mobile device (iOS). So is there a way to generate a Realm.io database from a Windows server through a console…
Chaaarly
  • 184
  • 14
1
vote
1 answer

Inconsistent results with parallel reads & writes in Realm

Maybe I'm missing something out but I'm getting some weird results while reading and writing in parallel from Realm, same object. I first encountered this in a bigger project but just managed now to reproduce it in a test project. Scenario: one…
Marcel N.
  • 13,726
  • 5
  • 47
  • 72
0
votes
2 answers

Realm exception when schema is created - on iOS only

This occurs at the first call to Realm.GetInstance. Happens only on iOS - while on Android it works fine. The Realm version is 0.77.2. This is a Xamarin project with MvvmCross and ReactiveUI, but most likely this doesn't matter. The call to…
Marcel N.
  • 13,726
  • 5
  • 47
  • 72
0
votes
2 answers

How to implement "get or create" query with Realm for Xamarin?

Consider the simple model: public class Session : RealmObject { [ObjectId] public string UserId { get; set; } public string Token { get; set; } } How to get the Session instance by ID or null if it doesn't exist? var realm =…
rudyryk
  • 3,695
  • 2
  • 26
  • 33
0
votes
1 answer

Realm net: sort by linked collection alternative

I have realm object Item with linked collection Properties: public class Item : RealmObject { public IList Properties { get; } public int Id {get; set;} .... } public class Property : RealmObject { public string Key {get;…
Semyon
  • 528
  • 5
  • 16