Class BacklinkAttribute
An attribute that indicates that the property it decorates is the inverse end of a relationship.
Namespace: Realms
Assembly: Realm.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
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
| Edit this page View SourceBacklinkAttribute(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. |
Properties
| Edit this page View SourceProperty
Gets the property that is on the other end of the relationship.
Declaration
public string Property { get; }
Property Value
Type | Description |
---|---|
string |