William Sullivan wrote:
> According to MSDN:
> How to: Visualize a Collection Association in 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
> In code, create a property or field whose type is itself a strongly-typed
> collection.
> In the class diagram, expand the class so that properties and fields are
> shown.
> 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.
> ___________________________________________________________________
>
> HOWEVER there may be a bug when it comes to generic collections where this
> fails. This might be your problem. If it doesn't work, make sure to fill
> out a bug report.
>
> Also, there are some power toys for the modeler, not sure if this will help
> you, but check it out anyway:
> PowerToys for the Visual Studio 2005 Class Designer and Distributed System
> Designers: Workspace Home (gotdotnet)
>
http://www.gotdotnet.com/workspaces/workspace.aspx?id=fe72608b-2b28-4cc1-9866-ea6f805f45f3 >
> "jdlwright@gmail.com" wrote:
>
> > Hi, I've just started using the class designer. However after much
> > googling I can't find how to do a 1 to many association between two
> > types.
> >
> > If I do a 1 to 1, it adds a property to one class. That's fine, so
> > logically you might thing 1 to many would be
> >
> > classA{
> >
> > public Collection<classB> ClassBs{
> > get{...}
> > set{...}
> > }
> > }
> >
> > it doesnt recognise that as an association.
> >
> > How do I do a 1 to many? Do I have to have a 1 to 1 assoc. to a
> > collection subclass and a 1 to 1 from the collection to classB?
> >
> > Thanks
> > Jim
> >
> >