0

I have realm object Item with linked collection Properties:

public class Item : RealmObject
{
    public IList<Property> Properties { get; }
    public int Id {get; set;}
    ....
}

public class Property : RealmObject
{
    public string Key {get; set;}
    public string Value {get; set;}   
}

And I need to sort to Item entities by properties from linked Properties collection. Something like this (I know it's not supported by Realm):

Realm.All<Item>().OrderBy(f => f.Properties.FirstOrDefault( p => p.Key == "Status").Value)

It is not possible to move properties to Item entity cause different items can contain different properties set which also may change over time. Is there other options to implement this kind of sorting? For now I see only option to sort objects in memory, but it may take too much memory on big dataset.

Semyon
  • 528
  • 5
  • 16

1 Answers1

0

This is not yet possible, I'm afraid.

We're going to be working on many LINQ improvements soon, but this particular request is on the complex side so it probably won't be something we will be able to offer in the near future.

Kristian Dupont
  • 800
  • 4
  • 12
  • Thank you for your answer. Is there some workaround available or planned? Cause this problem may become showstopper on big datasets. – Semyon Aug 05 '16 at 09:17