Page 1 of 1

Association for dummies

Posted: Thu 19 Feb 2009 12:07
by Bubblegum
I start the first time to work with an entity designer.
How can i make an simple association between this tables.

Adresse:
Field name:string
.
.
Field: CityId:int
==================
City
Field CityId:int
Field CityName:string

Posted: Thu 19 Feb 2009 15:36
by AndreyR
If there is an appropriate foreign key in your DB, the association should be generated automatically when both tables
are dropped on the designer surface.
Otherwise right-click on the designer surface, choose Add Association, set Parent (Addresse) and Child (City) class names
and the Association Properties (CityId in your example).
Judging from the example, you need the one-to-many cardinality. Press OK and the association should appear in the designer.

Posted: Sat 21 Feb 2009 06:15
by Bubblegum
thanks, now it works.
my problem was the direction of the association. Now it works fine!