Book a Demo

Author Topic: How to correctly model association for c#  (Read 3177 times)

Markus Hofer

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How to correctly model association for c#
« on: December 12, 2008, 06:41:21 am »
I just started to use EA for c# code generation from class diagrams. I could not yet figure out, how to correctly configure an association, so that correct code is generated. I have a 1:n relationship and I would expect EA to generate a collection of the associated elements. In my diagram absolutly nothing is generated for my association.

I has this to be done correctly? Thanks in advance for any idea or advice.

Markus

jkorman

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: How to correctly model association for c#
« Reply #1 on: December 12, 2008, 03:30:25 pm »
You probably need to do one of the following

Select Tools|Options|Source Code Engineering|C#

then select the [Collection Classes] button and enter a collection class
you wish to use for the [Default Collection Class]

or

You may select the Association Properties|Target Role tab and enter a collection class in the [Member Type] entry.

Then regenerate the classes. Use F12 (View Code) for a quick look to ensure the code was properly generated.

Jim