A good way for passing data with EventArgs public class EventArgs <TValue1> : EventArgs { public TValue1 Value1 { get ; set ; } public EventArgs(TValue1 value1) { Value1 = value1; } } Should you want to pass 2 values public class EventArgs <TValue1, TValue2> : EventArgs <TValue1> { public TValue2 Value2 { get ; set ; } public EventArgs(TValue1 value1, TValue2 value2) : base (value1) { Value2 = value2; } } The same goes to CancelEventArgs public class CancelEventArgs <TValue1>...
A convenient solution to get value from IDataReader field. /// <summary> /// Gets the reader field value. /// </summary> /// <typeparam name="TField"> The type of the field. </typeparam> /// <param name="reader"> The reader. </param> /// <param name="fieldName"> Name of the field. </param> /// <returns></returns> public static TField GetValue<TField>( this IDataReader reader, string fieldName) { //Guard...