Realm Xamarin  v0.78.0
Realm for Xamarin
Classes | Public Member Functions | Public Attributes | List of all members
RealmSchema Class Reference

Describes the complete set of classes which may be stored in a Realm, either from assembly declarations or, dynamically, by evaluating a Realm from disk. More...

Inheritance diagram for RealmSchema:
Inheritance graph
[legend]
Collaboration diagram for RealmSchema:
Collaboration graph
[legend]

Classes

class  Builder
 Helper class used to construct a RealmSchema. More...
 

Public Member Functions

ObjectSchema Find (string name)
 Finds the definition of a class in this schema. More...
 
IEnumerator< ObjectSchemaGetEnumerator ()
 Standard method from interface IEnumerable allows the RealmSchema to be used in a foreach or ToList(). More...
 

Public Attributes

int Count => _objects.Count
 Number of known classes in the schema. More...
 

Detailed Description

Describes the complete set of classes which may be stored in a Realm, either from assembly declarations or, dynamically, by evaluating a Realm from disk.

By default this will be all the RealmObjects in all your assemblies unless you restrict with RealmConfiguration.ObjectClasses. Just because a given class may be stored in a Realm doesn't imply much overhead. There will be a small amount of metadata but objects only start to take up space once written.

Member Function Documentation

§ Find()

ObjectSchema Find ( string  name)

Finds the definition of a class in this schema.

Parameters
nameA valid class name which may be in this schema.
Exceptions
ArgumentExceptionThrown if a name is not supplied.
Returns
An object or null to indicate not found.

§ GetEnumerator()

IEnumerator<ObjectSchema> GetEnumerator ( )

Standard method from interface IEnumerable allows the RealmSchema to be used in a foreach or ToList().

Returns
An IEnumerator which will iterate through ObjectSchema declarations in this RealmSchema.

References ObjectSchema.Builder.Build(), and ObjectSchema.FromType().

Member Data Documentation

§ Count

int Count => _objects.Count

Number of known classes in the schema.

Count of known classes specified in this Schema.