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>.this[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 RealmSchema.Builder : SchemaBuilderBase<ObjectSchema>, IEnumerable<ObjectSchema>, IEnumerable

    Constructors

    | Edit this page View Source

    Builder()

    Initializes a new instance of the RealmSchema.Builder class.

    Declaration
    public Builder()

    Methods

    | Edit this page 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.

    | Edit this page View Source

    Add(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(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)
        }
    }
    | Edit this page 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.

    | Edit this page 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.

    Implements

    IEnumerable<T>
    IEnumerable
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2020-2024 Realm
    Generated by DocFX