Author Topic: C# using directive / Code generation problem  (Read 528 times)


  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
C# using directive / Code generation problem
« on: September 16, 2011, 09:02:30 am »
Since this is my first post, I'd like to say a warm hello to you all  :)

I'm new to EA, so I have a lot to learn.
So far I've been doing good, but now I discovered somethin strange regarding the code generation for C#.
Say we have a root package "Interface" marked as namespace root.
A child package of "Interface" is "test" and within "test" we have classes "Order" and "OrderType".
Now, "Order" has an aggregation to "OrderType", this means that "OrderType" is an element of "Order".
Now, see the result of the code generation:
Code: [Select]
using test;
namespace test {
      public class Order {

            public int ID;
            public test.OrderType m_OrderType;

            public Order(){




            public virtual void Dispose(){


      }//end Order

}//end namespace test

While this code seems to compile, I don't think it is quite nice.
Why is there a "using test;" line right before the "namespace test" block?
And why would one write "using test;" when in line 6 "public test.OrderType m_OrderType;" the scope test is again written?
I would have expected this line to be "public OrderType m_OrderType;"

Do you have an idea of how to get rid of the "using" statement and the test scope qualifier in line 6?

Thanks in advance and best regards