How to: Visualize a Collection Association (Class Designer)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at How to: Visualize a Collection Association (Class Designer).

Properties and fields that are collections of other types can be displayed on the class diagram as a collection association. Unlike a regular association, which displays a field or property as a line linking the owning class to the field's type, a collection association is displayed as a line linking the owning class to the collected type.

To create a collection association

  1. In code, create a property or field whose type is itself a strongly-typed collection.

  2. In the class diagram, expand the class so that properties and fields are shown.

  3. In the class, right-click the field or property and choose Show as Collection Association.

    The property or field is shown as an association line linking to the collected type.

How to: Create Associations Between Types (Class Designer)
Designing Classes and Types (Class Designer)
Viewing Types and Relationships (Class Designer)

Show: