Partager via


AssociationAttribute Constructor

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of the AssociationAttribute class.

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

Syntax

'Declaration
Public Sub New ( _
    name As String, _
    thisKey As String, _
    otherKey As String _
)
public AssociationAttribute(
    string name,
    string thisKey,
    string otherKey
)

Parameters

  • name
    Type: System.String
    The name of the association. For bidirectional associations, the name must be the same on both sides of the association.
  • thisKey
    Type: System.String
    A comma-separated list of the property names of the key values on this side of the association.
  • otherKey
    Type: System.String
    A comma-separated list of the property names of the key values on the other side of the association.

Remarks

When you apply an AssociationAttribute to a member in a WCF RIA Services solution, you must define the same number of keys on both sides of the relationship. If you do not provide the same number of keys to both sides of the relationship, you will receive an error when building the solution.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.