[...]"Best" is such a hard thing to say for sure.
public class CellValidatedEventArgs<TRow: EventArgs
where TRow : class , IRow
{
[...]
}
My entity base class contains empty method to allow override :
class EntityBase {
public virtual void OnRowCellValidated<TRow>(TRow sender,
CellValidatedEventArgs<TRowe)
where TRow : class, IRow { }
}
Is this best design pattern ?
I will point out that the usual .NET pattern is for the "sender" parameter
to simply be of type Object. I will also point out that the usual .NET
pattern has the "sender" being the instance of the class implementing the
"OnXXX()" method. If, as Ignacio suggests, the EntityBase class is
inherited by whatever TRow winds up being, the example you give seems fine
but you should constrain TRow to match. On the other hand, if TRow is not
derived from EntityBase, then perhaps the EntityBase class isn't the best
place to put the event and related implementation.
All that said, I don't see anything fundamentally wrong with what you
posted, so far as it goes. There's not enough detail to assess whether
it's good _or_ bad.
Pete