Author Topic: .Net Generic method parameters?  (Read 2720 times)

frik_stuart

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • MDA is the future!
    • View Profile
.Net Generic method parameters?
« on: February 09, 2009, 07:25:09 pm »
I have a generic class that is defined in C# as follows:
public class Repository<T> : IRepository<T>

It has a method that takes an instance of type T as a parameter:
public virtual void Add(T entity);

I am trying to work out how to define this Parameterised parameter in the EA Parameters dialog for my operation? Would I enter <T> in the "Type:" droplist?

Reverse engineering the UML from the class definition also didn't work since the above "Add" method came back with no parameters defined. I was also unable to define the Parameterised Type for the Interface since the "Details" tab is not available. I presume these are bugs?

Any ideas from anyone how to solve this problem? It would make my round-trip engineering pretty much useless of this standard .Net2.0 functionality is not supported.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: .Net Generic method parameters?
« Reply #1 on: February 09, 2009, 11:52:00 pm »
I think you have to look up the parameter list (of the parameterized class) and define the type(s) for the parameter(s) there.
No, you can't have it!