Class FlexibleSyncConfiguration
A Flexible
Inherited Members
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public class FlexibleSyncConfiguration : SyncConfigurationBase
Constructors
| Edit this page View SourceFlexibleSyncConfiguration(User, string?)
Initializes a new instance of the Flexible
Declaration
public FlexibleSyncConfiguration(User user, string? optionalPath = null)
Parameters
Type | Name | Description |
---|---|---|
User | user | A valid User. |
string | optionalPath | Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename. |
Properties
| Edit this page View SourcePopulateInitialSubscriptions
Gets or sets a callback that will be invoked the first time a Realm is opened.
Declaration
public FlexibleSyncConfiguration.InitialSubscriptionsDelegate? PopulateInitialSubscriptions { get; set; }
Property Value
Type | Description |
---|---|
Flexible |
The Flexible |
Remarks
This callback allows you to populate an initial set of subscriptions, which will
then be awaited when Get
The Subscription
Examples
var config = new FlexibleSyncConfiguration(user)
{
PopulateInitialSubscriptions = (realm) =>
{
var myNotes = realm.All<Note>().Where(n => n.AuthorId == myUserId);
realm.Subscriptions.Add(myNotes);
}
};
// The task will complete when all the user notes have been downloaded.
var realm = await Realm.GetInstanceAsync(config);