When more than one association of the same type exists on a model use
this attribute to specify the name of the reverse association field on the target
type. The attribute only needs to be applied to one end of the association (either one)
not both.
N.B. This is only required when there is more than one association between
two models. i.e. One table has more than one foreign key to another table.
Examples
CopyC#


// type Contribution private readonly EntityHolder<Member> _approvedBy = new EntityHolder<Member>(); private readonly EntityHolder<Member> _contributor = new EntityHolder<Member>(); // type Member [ReverseAssociation("Contributor")] private readonly EntityCollection<Contribution> _contributions = new EntityCollection<Contribution>(); [ReverseAssociation("ApprovedBy")] private readonly EntityCollection<Contribution> _approvedContributions = new EntityCollection<Contribution>();

C# | Visual Basic |
[AttributeUsageAttribute(AttributeTargets.Field, AllowMultiple = false, Inherited = false)] public sealed class ReverseAssociationAttribute : Attribute
<AttributeUsageAttribute(AttributeTargets.Field, AllowMultiple := False, Inherited := False)> _ Public NotInheritable Class ReverseAssociationAttribute _ Inherits Attribute

All Members | Constructors | Properties | |||
Icon | Member | Description |
---|---|---|
![]() | ReverseAssociationAttribute(String) |
Initializes a new instance of the ReverseAssociationAttribute class.
|
![]() | FieldName |
The name of the field representing the reverse association.
|