Data Access has been discontinued. Please refer to this page for more information.

CollectionAttribute

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

The CollectionAttribute is used to designate a property as an inverse collection in a one-to-many or a many-to-many relationship. The CollectionAttribute exposes one property - InverseProperty. The string InverseProperty property is used to set the name of the field on the opposite side of the association.

class Territory
{
   private IList<Employee> employees;
   [Collection( InverseProperty = "territories" )]
   [Storage( "employees" )]
   public IList<Employee> Employees
   {
       get
       {
           return employees;
       }
   }
}
Public Class Territory
 Private _employees As IList(Of Employee)
 <Collection(InverseProperty := "territories"), Storage("employees")>
 Public ReadOnly Property Employees() As IList(Of Employee)
  Get
   Return _employees
  End Get
 End Property
End Class