-
Notifications
You must be signed in to change notification settings - Fork 174
Add support for value substitution in string based queries #2201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 44 commits
6fe3aed
b73b62d
ca13f01
d3c4d48
f30fad0
67dfc41
89ae7f5
6c827a5
9533901
cfb927e
cbc60cb
580699d
b01db8c
0f49239
0f0d18e
fd43ddb
256369a
37342c1
775bc51
c9fc593
a63bd5c
0f0be4f
faf5d2b
6d06ad6
943be4f
e7ad03e
0ad8d7d
0a44eb5
7a1fe0b
7ccc215
5ac3b31
ea52b5e
0f6253c
eebf8e2
d16127a
9d37a7c
80fdbaf
844ac8a
4ba9d71
c7e9790
41d3d02
2050194
65e1cf5
a98d164
10976dd
a390ead
37924d3
7520217
10cf0a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -197,6 +197,7 @@ public static IDisposable SubscribeForNotifications<T>(this IDictionary<string, | |||||
| /// A Queryable collection, obtained by calling <see cref="Realm.All{T}"/>. | ||||||
| /// </param> | ||||||
| /// <param name="predicate">The predicate that will be applied.</param> | ||||||
| /// <param name="arguments">Values used for substitution in the predicate. Note that all primitive types are accepted as they are implicitly converted to RealmValue.</param> | ||||||
| /// <returns>A queryable observable collection of objects that match the predicate.</returns> | ||||||
| /// <remarks> | ||||||
| /// This method can be used in combination with LINQ filtering, but it is strongly recommended | ||||||
|
|
@@ -210,16 +211,18 @@ public static IDisposable SubscribeForNotifications<T>(this IDictionary<string, | |||||
| /// var results1 = realm.All<Foo>("Bar.IntValue > 0"); | ||||||
| /// var results2 = realm.All<Foo>("Bar.IntValue > 0 SORT(Bar.IntValue ASC Bar.StringValue DESC)"); | ||||||
| /// var results3 = realm.All<Foo>("Bar.IntValue > 0 SORT(Bar.IntValue ASC Bar.StringValue DESC) DISTINCT(Bar.IntValue)"); | ||||||
| /// var results4 = realm.All<Foo>("Bar.IntValue > $0 || (Bar.String == $1 && Bar.Bool == $2)" 5, "small", true"); | ||||||
|
||||||
| /// var results4 = realm.All<Foo>("Bar.IntValue > $0 || (Bar.String == $1 && Bar.Bool == $2)" 5, "small", true"); | |
| /// var results4 = realm.All<Foo>("Bar.IntValue > $0 || (Bar.String == $1 && Bar.Bool == $2)", 5, "small", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this posted only now? I do remember not seeing the suggestion after the talk in the call. Anyway, it's already fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you validate that arguments is not null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking to throw an exception (Argument.NotNull(obj, paramName)). Would that be fine or would you just return an empty result and let the dev figure out the why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - Argument.NotNull sounds correct.
Uh oh!
There was an error while loading. Please reload this page.