Class NamedSubscription
A managed Realm object representing a subscription. Subscriptions are used by Query-based Realms to define which data should be available on the device. It is the persisted version of a Subscription<T> created by calling Subscribe<T>(IQueryable<T>, SubscriptionOptions, Expression<Func<T, IQueryable>>[]).
Inherited Members
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
[MapTo("__ResultSets")]
public class NamedSubscription : RealmObject, INotifyPropertyChanged, ISchemaSource, IThreadConfined, NotificationsHelper.INotifiable, IReflectableType
Properties
| Improve this Doc View SourceCreatedAt
Gets the point in time when the subscription was created.
Declaration
[MapTo("created_at")]
public DateTimeOffset CreatedAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset | The creation date of the subscription. |
Error
Gets a value indicating what error (if any) has occurred while processing the subscription.
If the State is not Error, this will be null
.
Declaration
public Exception Error { get; }
Property Value
Type | Description |
---|---|
Exception | An instance of Exception if an error has occurred; |
ExpiresAt
Gets the point in time when the subscription will expire and become eligible for removal.
Declaration
[MapTo("expires_at")]
public DateTimeOffset? ExpiresAt { get; }
Property Value
Type | Description |
---|---|
Nullable<DateTimeOffset> | The expiration date of the subscription. |
Remarks
Realm will automatically remove expired subscriptions at opportunistic times. There are no guarantees as to when the subscription will be removed.
Name
Gets the name of the subscription. If no name was provided in Name, then an automatic name will have been generated based on the query.
Declaration
[MapTo("name")]
[Indexed]
[Required]
public string Name { get; }
Property Value
Type | Description |
---|---|
String | The subscription name. |
ObjectType
Gets the type of the object that this subscription is applied to.
Declaration
public string ObjectType { get; }
Property Value
Type | Description |
---|---|
String | The type of the object that the subscription matches. |
Query
Gets the string representation of the query used to create the subscription.
Declaration
[MapTo("query")]
[Required]
public string Query { get; }
Property Value
Type | Description |
---|---|
String | The subscription query. |
State
Gets a value indicating the state of this subscription.
Declaration
public SubscriptionState State { get; }
Property Value
Type | Description |
---|---|
SubscriptionState | The state of the subscription. |
TimeToLive
Gets the time to live of the subscription.
Declaration
public TimeSpan? TimeToLive { get; }
Property Value
Type | Description |
---|---|
Nullable<TimeSpan> | The subscription's time to live. |
UpdatedAt
Gets the point in time when the subscription was updated.
Declaration
[MapTo("updated_at")]
public DateTimeOffset UpdatedAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset | The last updated date of the subscription. |
Remarks
In this context, "updated" means that the subscription was resubscribed to or some property was updated by calling Subscribe<T>(IQueryable<T>, SubscriptionOptions, Expression<Func<T, IQueryable>>[]). The field is NOT updated whenever the results of the query changes.