public static void ConfigureTwoFactorAuthenticationPolicy <TAccount>(this UserAccountService <TAccount> svc, ITwoFactorAuthenticationPolicy policy) where TAccount : UserAccount { if (svc == null) { throw new ArgumentNullException("account"); } svc.AddCommandHandler(new TwoFactorAuthPolicyCommandHandler(policy)); }