Class BacklinkAttribute
An attribute that indicates that the property it decorates is the inverse end of a relationship.
Inherited Members
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)
Namespace:Realms
Assembly:Realm.dll
Syntax
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class BacklinkAttribute : Attribute, _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 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. |