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