Class RealmConfigurationBase
Base class for specifying configuration settings that affect the Realm's behavior.
Inherited Members
Namespace:Realms
Assembly:Realm.dll
Syntax
public abstract class RealmConfigurationBase
Remarks
Its main role is generating a canonical path from whatever absolute, relative subdirectory, or just filename the user supplies.
Properties
| Improve this Doc View SourceDatabasePath
Gets or sets the full path of the Realms opened with this Configuration. May be overriden by passing in a separate name.
Declaration
public string DatabasePath { get; protected set; }
Property Value
Type | Description |
---|---|
String | The absolute path to the Realm. |
DefaultRealmName
Gets the filename to be combined with the platform-specific document directory.
Declaration
public static string DefaultRealmName { get; }
Property Value
Type | Description |
---|---|
String | A string representing a filename only, no path. |
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 |
---|---|
System.Byte[] | Full 64byte (512bit) key for AES-256 encryption. |
ObjectClasses
Gets or sets the list of classes persisted in a Realm opened with this configuration.
Declaration
public Type[] ObjectClasses { get; set; }
Property Value
Type | Description |
---|---|
Type[] | The classes that can be persisted in the Realm. |
Remarks
Typically left null so by default all RealmObjects will be able to be stored in all Realms.
Examples
config.ObjectClasses = new Type[]
{
typeof(CommonClass),
typeof(RareClass)
};
|
Improve this Doc
View Source
SchemaVersion
Gets or sets a number, indicating the version of the schema. Can be used to arbitrarily distinguish between schemas even if they have the same objects and properties.
Declaration
public ulong SchemaVersion { get; set; }
Property Value
Type | Description |
---|---|
UInt64 | 0-based value initially set to zero so all user-set values will be greater. |
Methods
| Improve this Doc View SourceGetPathToRealm(String)
Utility to build a path in which a Realm will be created so can consistently use filenames and relative paths.
Declaration
public static string GetPathToRealm(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. |
Returns
Type | Description |
---|---|
String | A full path including name of Realm file. |