Class RealmConfiguration
Realm configuration specifying settings that affect the Realm's behavior.
Its main role is generating a canonical path from whatever absolute, relative subdirectory, or just filename the user supplies.
Inherited Members
Namespace: Realms
Assembly: Realm.dll
Syntax
public class RealmConfiguration : RealmConfigurationBase
Constructors
| Edit this page View SourceRealmConfiguration(string?)
Initializes a new instance of the RealmConfiguration class.
Declaration
public RealmConfiguration(string? optionalPath = null)
Parameters
Type | Name | Description |
---|---|---|
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 SourceDefaultConfiguration
Gets or sets the RealmConfigurationBase that is used when creating a new Realm without specifying a configuration.
Declaration
public static RealmConfigurationBase DefaultConfiguration { get; set; }
Property Value
Type | Description |
---|---|
RealmConfigurationBase | The default configuration. |
EncryptionKey
Gets or sets the key, used to encrypt the entire Realm. Once set, must be specified each time the file is used.
Declaration
public byte[]? EncryptionKey { get; set; }
Property Value
Type | Description |
---|---|
byte[] | Full 64byte (512bit) key for AES-256 encryption. |
IsReadOnly
Gets or sets a value indicating whether a Realm is opened as readonly. This allows opening it from locked locations such as resources, bundled with an application.
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
MigrationCallback
Gets or sets the migration callback.
Declaration
public RealmConfiguration.MigrationCallbackDelegate? MigrationCallback { get; set; }
Property Value
Type | Description |
---|---|
RealmConfiguration.MigrationCallbackDelegate | The RealmConfiguration.MigrationCallbackDelegate that will be invoked if the Realm needs to be migrated. |
ShouldDeleteIfMigrationNeeded
Gets or sets a value indicating whether the database will be deleted if the RealmSchema
mismatches the one in the code. Use this when debugging and developing your app but never release it with
this flag set to true
.
Declaration
public bool ShouldDeleteIfMigrationNeeded { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
Methods
| Edit this page View SourceConfigWithPath(string)
Clone method allowing you to override or customize the current path.
Declaration
public RealmConfiguration ConfigWithPath(string newConfigPath)
Parameters
Type | Name | Description |
---|---|---|
string | newConfigPath | Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename. |
Returns
Type | Description |
---|---|
RealmConfiguration | An object with a fully-specified, canonical path. |