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"?

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked May 23 '10 at 02:00

ara's gravatar image

ara
395838791


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
29714412

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA