Search Results for

    Show / Hide Table of Contents

    Class BacklinkAttribute

    An attribute that indicates that the property it decorates is the inverse end of a relationship.

    Inheritance
    Object
    Attribute
    BacklinkAttribute
    Namespace: Realms
    Assembly: Realm.dll
    Syntax
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public sealed class BacklinkAttribute : Attribute
    Examples
    class Dog : RealmObject
    {
        // One to many relationship with Person.Dogs
        public Person Owner { get; set; }
    }
    
    class Person : RealmObject
    {
        [Backlink(nameof(Dog.Owner))]
        public IQueryable<Dog> Dogs { get; }
    
        // Many to many relationship with Hobby.PeopleWithThatHobby
        public IList<Hobby> Hobbies { get; }
    }
    
    class Hobby : RealmObject
    {
        [Backlink(nameof(Person.Hobbies))]
        public IQueryable<Person> PeopleWithThatHobby { get; }
    }

    Constructors

    | Improve this Doc View Source

    BacklinkAttribute(String)

    Initializes a new instance of the BacklinkAttribute class.

    Declaration
    public BacklinkAttribute(string property)
    Parameters
    Type Name Description
    String property

    The property that is on the other end of the relationship.

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