Search Results for

    Show / Hide Table of Contents

    Class RealmSchema.Builder

    A mutable builder that allows you to construct a RealmSchema instance.

    Inheritance
    Object
    SchemaBuilderBase<ObjectSchema>
    RealmSchema.Builder
    Implements
    IEnumerable<ObjectSchema>
    IEnumerable
    Inherited Members
    SchemaBuilderBase<ObjectSchema>._values
    SchemaBuilderBase<ObjectSchema>.Item[String]
    SchemaBuilderBase<ObjectSchema>.Count
    SchemaBuilderBase<ObjectSchema>.Remove(ObjectSchema)
    SchemaBuilderBase<ObjectSchema>.Remove(String)
    SchemaBuilderBase<ObjectSchema>.Contains(ObjectSchema)
    SchemaBuilderBase<ObjectSchema>.Contains(String)
    Namespace: Realms.Schema
    Assembly: Realm.dll
    Syntax
    public class Builder : SchemaBuilderBase<ObjectSchema>, IEnumerable<ObjectSchema>, IEnumerable

    Constructors

    | Improve this Doc View Source

    Builder()

    Initializes a new instance of the RealmSchema.Builder class.

    Declaration
    public Builder()

    Methods

    | Improve this Doc View Source

    Add(ObjectSchema)

    Adds a new ObjectSchema to this RealmSchema.Builder.

    Declaration
    public RealmSchema.Builder Add(ObjectSchema schema)
    Parameters
    Type Name Description
    ObjectSchema schema

    The ObjectSchema to add.

    Returns
    Type Description
    RealmSchema.Builder

    The original RealmSchema.Builder instance to enable chaining multiple Add(ObjectSchema) calls.

    | Improve this Doc View Source

    Add(ObjectSchema.Builder)

    Adds a new ObjectSchema.Builder to this RealmSchema.Builder.

    Declaration
    public RealmSchema.Builder Add(ObjectSchema.Builder schemaBuilder)
    Parameters
    Type Name Description
    ObjectSchema.Builder schemaBuilder

    The ObjectSchema.Builder to add.

    Returns
    Type Description
    RealmSchema.Builder

    The original RealmSchema.Builder instance to enable chaining multiple Add(ObjectSchema.Builder) calls.

    Remarks

    This is a convenience method that will call Build() internally. It is intended to simplify declarative schema construction via collection initializers:

    var schema = new RealmSchema.Builder
    {
        new ObjectSchema.Builder("MyClass", isEmbedded: false)
        {
            Property.Primitive("MyProperty", RealmValueType.Int)
        }
    }
    | Improve this Doc View Source

    Add(Type)

    Adds a new Type to this RealmSchema.Builder.

    Declaration
    public RealmSchema.Builder Add(Type type)
    Parameters
    Type Name Description
    Type type

    The Type to add. It will be converted to ObjectSchema and added to the builder.

    Returns
    Type Description
    RealmSchema.Builder

    The original RealmSchema.Builder instance to enable chaining multiple Add(Type) calls.

    | Improve this Doc View Source

    Build()

    Constructs a RealmSchema from the properties added to this RealmSchema.Builder.

    Declaration
    public RealmSchema Build()
    Returns
    Type Description
    RealmSchema

    An immutable RealmSchema instance that contains the properties added to the RealmSchema.Builder.

    | Improve this Doc View Source

    GetKey(ObjectSchema)

    Declaration
    protected override string GetKey(ObjectSchema item)
    Parameters
    Type Name Description
    ObjectSchema item
    Returns
    Type Description
    String
    Overrides
    Realms.Schema.SchemaBuilderBase<Realms.Schema.ObjectSchema>.GetKey(Realms.Schema.ObjectSchema)

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2020 Realm
    Generated by DocFX