Reputation: 1202
Tried this but it doesn't work:
int maxValue = realm.All<myTable>().Max<myTable>().intProperty;
I'm getting error message:
System.NotSupportedException: The method 'Max' is not supported
Upvotes: 4
Views: 678
Reputation: 726809
In LINQ you need to supply an expression selecting the property to Max()
method:
int maxValue = realm.All<myTable>().Max(item => item.intProperty);
This may not work in LINQ 2 Entity, so use
int maxValue = realm
.All<myTable>()
.OrderByDescending(item => item.intProperty)
.First().intProperty;
Upvotes: 4