Would it be possible to change the signature of the OnAdd method from OnAdd(Entity item) to OnAdd(TItem item)?

Also, what do you think of renaming TItem to TEntity (or T) and "item" to "entity"?


asked May 23 '10 at 02:00

ara's gravatar image


One Answer:

OnAdd is declated in untyped EntitySetBase - that's why it accepts Entity argument. Adding its typed version in EntitySet<t> seems a good idea.

Concerning renaming of item argument to entity: I'm not sure. Naming method argument based on its type = hungarian notation. May be we should rename TItem to TEntity to expose its type constraint?

answered May 24 '10 at 07:44

Alex%20Yakunin's gravatar image

Alex Yakunin

Your answer
toggle preview

powered by OSQA