Book a Demo

Author Topic: C#  Add Property to Attribute  (Read 4351 times)

Fehma

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
C#  Add Property to Attribute
« on: August 02, 2011, 12:03:53 am »
Hi there,

I actually created a Class with an Attribute via c# without a Problem.
Now I want to mark this Attribute as Property and also provide the PropertyName.


Any Ideas ?

Greetings

Marcus

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: C#  Add Property to Attribute
« Reply #1 on: August 02, 2011, 05:01:22 am »
Marcus,

Do the necessarily in EA, and then check in the database what changed.
That is usually the best way to figure out these things.

Geert

Fehma

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C#  Add Property to Attribute
« Reply #2 on: August 02, 2011, 05:47:14 pm »
Hi Geert ,

thank you very much for your answer. I have actuall tried it and I saw ( your addons helped me a lot :-) ) that the only value it set on t_attribut was GenOption with the value PROPERTY=testContextInstance;

But on EA.Attribut there is now way to set GenOption...

Any Idea ?

Greetings

Marcus

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: C#  Add Property to Attribute
« Reply #3 on: August 02, 2011, 06:07:54 pm »
Marcus,

I would check the values in Style and StyleEx. If those don't contain the values you are looking for then I'm afraid they only option you have is to go to the database directly.
Use Repository.SQLQuery() for retrieving and Repository.Execute() for updates.

Geert

Fehma

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C#  Add Property to Attribute
« Reply #4 on: August 02, 2011, 06:11:11 pm »
Geert,

again tons of thx for the quick answer..
I guess I have to go for the SQL Solution .

Greetings

Marcus

Fehma

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C#  Add Property to Attribute
« Reply #5 on: August 02, 2011, 07:40:12 pm »
hmmm I found SQlQuery but I can't find Repository.Execute()

Geert any Ideas where I can find the Execute Function ?

Greetings

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: C#  Add Property to Attribute
« Reply #6 on: August 02, 2011, 08:43:23 pm »
It's there trust me, it's just a hidden operation.
Try it out and you'll see

Geert

Fehma

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C#  Add Property to Attribute
« Reply #7 on: August 02, 2011, 08:49:30 pm »
he he  ;D

it is working.....

Tons of thx....

Marcus