Book a Demo

Author Topic: Code Generation in C#  (Read 11481 times)

mbaffa

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Code Generation in C#
« on: December 27, 2008, 11:19:07 am »
Hi,

I have a C# class that has a property and I need to define an attribute for this property. In fact I am working with Unity Application Block and I need to define the attribute [Dependency] to inject a concrete class in my Class. Something like this:

private IAccount _account;

[Dependency]
public IAccount account{
  get { return _account; }
  set { _account = value; }
}

The problem is that when I generate the code, even with the "Always syncronize" option selected, the attribute disappears. The final code does not have the attribute.

What must I do to maintain my attibute ???

Thanks in advance

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation in C#
« Reply #1 on: December 29, 2008, 09:18:47 am »
The attribute needs to be modelled in a tagged value on the operation (property).

Try reverse engineering it to see for yourself.