using System; namespace Pinwheel { public abstract class AwardRule : IAwardRule where T : AwardContext { public void Execute(AwardContext context) { if (context == null) throw new ArgumentNullException("context"); var buildContext = context as T; if (buildContext != null) Execute(buildContext); } protected abstract void Execute(T context); } }