Class Subscription
A set of helper methods exposing partial-sync related functionality over collections.
Namespace: Realms.Sync
Assembly: Realm.Sync.dll
Syntax
public static class Subscription : object
Methods
| Improve this Doc View SourceSubscribe<T>(IQueryable<T>, String)
For partially synchronized Realms, fetches and synchronizes the objects that match the query.
Declaration
public static Subscription<T> Subscribe<T>(this IQueryable<T> query, string name = null)
Parameters
Type | Name | Description |
---|---|---|
IQueryable<T> | query | A query, obtained by calling All<T>() with or without additional filtering applied. |
String | name | The name of this query that can be used to unsubscribe from. |
Returns
Type | Description |
---|---|
Subscription<T> | A Subscription<T> instance that contains information and methods for monitoring the state of the subscription. |
Type Parameters
Name | Description |
---|---|
T | The type of the objects making up the query. |
UnsubscribeAsync(Realm, String)
Cancel a named subscription that was created by calling Subscribe<T>(IQueryable<T>, String).
Removing a subscription will delete all objects from the local Realm that were matched only by that subscription and not any remaining subscriptions. The deletion is performed by the server, and so has no immediate impact on the contents of the local Realm. If the device is currently offline, the removal will not be processed until the device returns online.
Declaration
public static Task UnsubscribeAsync(this Realm realm, string subscriptionName)
Parameters
Type | Name | Description |
---|---|---|
Realm | realm | The Realm where this subscription was added. |
String | subscriptionName | The name of the subscription to remove. |
Returns
Type | Description |
---|---|
Task | An awaitable task, that indicates that the subscription has been removed locally. |
UnsubscribeAsync<T>(Subscription<T>)
Cancel a subscription that was created by calling Subscribe<T>(IQueryable<T>, String).
Removing a subscription will delete all objects from the local Realm that were matched only by that subscription and not any remaining subscriptions. The deletion is performed by the server, and so has no immediate impact on the contents of the local Realm. If the device is currently offline, the removal will not be processed until the device returns online.
Declaration
public static Task UnsubscribeAsync<T>(this Subscription<T> subscription)
Parameters
Type | Name | Description |
---|---|---|
Subscription<T> | subscription | The subscription to cancel. |
Returns
Type | Description |
---|---|
Task | An awaitable task, that indicates that the subscription has been removed locally. |
Type Parameters
Name | Description |
---|---|
T | The type of the objects that make up the subscription query. |