Search Results for

    Show / Hide Table of Contents

    Class RealmConfigurationBase

    Base class for specifying configuration settings that affect the Realm's behavior.

    Inheritance
    Object
    RealmConfigurationBase
    InMemoryConfiguration
    RealmConfiguration
    SyncConfigurationBase
    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 Source

    DatabasePath

    Gets or sets the full path of the Realms opened with this Configuration. May be overridden by passing in a separate name.

    Declaration
    public string DatabasePath { get; protected set; }
    Property Value
    Type Description
    String

    The absolute path to the Realm.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 virtual byte[] EncryptionKey { get; set; }
    Property Value
    Type Description
    Byte[]

    Full 64byte (512bit) key for AES-256 encryption.

    | Improve this Doc View Source

    FallbackPipePath

    Gets or sets the path where the named pipes used by Realm can be placed.

    Declaration
    public string FallbackPipePath { get; set; }
    Property Value
    Type Description
    String

    The path where named pipes can be created.

    Remarks

    In the vast majority of cases this value should be left null. It needs to be set if the Realm is opened on a filesystem where a named pipe cannot be created, such as external storage on Android that uses FAT32. In this case the path should point to a location on a filesystem where the pipes can be created.

    | Improve this Doc View Source

    IsDynamic

    Gets or sets a value indicating whether the Realm will be open in dynamic mode. If opened in dynamic mode, the schema will be read from the file on disk.

    Declaration
    public bool IsDynamic { get; set; }
    Property Value
    Type Description
    Boolean

    true if the Realm will be opened in dynamic mode; false otherwise.

    | Improve this Doc View Source

    MaxNumberOfActiveVersions

    Gets or sets the maximum number of active versions allowed before an exception is thrown.

    Declaration
    public ulong MaxNumberOfActiveVersions { get; set; }
    Property Value
    Type Description
    UInt64
    See Also
    Freeze()
    | Improve this Doc View Source

    ObjectClasses

    Gets or sets the list of classes persisted in a Realm opened with this configuration.

    Declaration
    [Obsolete("Use Schema = new[] { typeof(...) } instead.")]
    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 and EmbeddedObjects will be able to be stored in all Realms.

    Examples
    config.ObjectClasses = new Type[]
    {
        typeof(CommonClass),
        typeof(RareClass)
    };
    | Improve this Doc View Source

    Schema

    Gets or sets the schema of the Realm opened with this configuration.

    Declaration
    public RealmSchema Schema { get; set; }
    Property Value
    Type Description
    RealmSchema

    The schema of the types that can be persisted in the Realm.

    Remarks

    Typically left null so by default all RealmObjects and EmbeddedObjects will be able to be stored in all Realms.
    If specifying the schema explicitly, you can either use the implicit conversion operator from Type[] to RealmSchema or construct it using the RealmSchema.Builder API.

    Examples
    config.Schema = new Type[]
    {
        typeof(CommonClass),
        typeof(RareClass)
    };
    
    // Alternatively
    config.Schema = new RealmSchema.Builder
    {
        new ObjectSchema.Builder("Person")
        {
            Property.Primitive("Name", RealmValueType.String, isPrimaryKey: true),
            Property.Primitive("Birthday", RealmValueType.Date, isNullable: true),
            Property.ObjectList("Addresses", objectType: "Address")
        },
        new ObjectSchema.Builder("Address")
        {
            Property.Primitive("City", RealmValueType.String),
            Property.Primitive("Street", RealmValueType.String),
        }
    }
    | 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 Source

    GetPathToRealm(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.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2020 Realm
    Generated by DocFX