Setting Command Timeout - Entity Framework 6 - .NET Framework

public static class DbContextExtensions
{
    public enum ConfiguredCommand{SalesReport}

    public static void SetConfiguredCommandTimeout(this MyDbContext db, ConfiguredCommand cmd)
    {
        var appSetting = "CommandTimeout." + cmd.ToString();
        var s = ConfigurationManager.AppSettings[appSetting];
        int n;

        if (int.TryParse(s, out n))
            db.Database.CommandTimeout = n;

    }
}