public bool DeleteUserTeamCup(int cupid, SqlConnection db)
        {
            try
            {
                bool rowsDeleted = false;
                var  cup         = new UserTeamCupMatch();

                cup         = db.Get <UserTeamCupMatch>(cupid);
                rowsDeleted = db.Delete(new UserTeamCupMatch()
                {
                    id = cupid
                });

                if (rowsDeleted == true)
                {
                    Logger.Out("Cup: " + cup.entry_1_name + " v " + cup.entry_2_name + " (" + Convert.ToString(cupid) + ") - deleted");
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("UserTeamCup Repository (DeleteCup) error: " + ex.Message);
                throw ex;
            }
        }
        public bool DeleteUserTeamCup(int cupid, SqlConnection db)
        {
            try
            {
                bool rowsDeleted = false;
                var  cup         = new UserTeamCupMatch();

                //using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["FantasyPremierLeagueUserTeam"].ConnectionString))
                //{
                cup         = db.Get <UserTeamCupMatch>(cupid);
                rowsDeleted = db.Delete(new UserTeamCupMatch()
                {
                    id = cupid
                });
                //}

                if (rowsDeleted == true)
                {
                    Logger.Out("Cup: " + cup.entry_1_name + " v " + cup.entry_2_name + " (" + Convert.ToString(cupid) + ") - deleted");
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("Cup Repository (DeleteCup) error: " + ex.Message);
                throw ex;
            }
        }
        public bool UpdateUserTeamCup(UserTeamCupMatch cup, SqlConnection db)
        {
            try
            {
                bool rowsUpdated = false;

                rowsUpdated = db.Update(cup, commandTimeout: 0);

                if (rowsUpdated == true)
                {
                    Logger.Out("Cup: " + cup.entry_1_name + " v " + cup.entry_2_name + " - updated");
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("UserTeamCup Repository (update) error: " + ex.Message);
                throw ex;
            }
        }
        public bool UpdateUserTeamCup(UserTeamCupMatch cup, SqlConnection db)
        {
            try
            {
                bool rowsUpdated = false;

                //using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["FantasyPremierLeagueUserTeam"].ConnectionString))
                //{
                rowsUpdated = db.Update(cup);
                //}

                if (rowsUpdated == true)
                {
                    Logger.Out("Cup: " + cup.entry_1_name + " v " + cup.entry_2_name + " - updated");
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("Cup Repository (update) error: " + ex.Message);
                throw ex;
            }
        }
        public bool InsertUserTeamCup(UserTeamCupMatch cup, SqlConnection db)
        {
            try
            {
                long rowsAffected = 0;

                //using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["FantasyPremierLeagueUserTeam"].ConnectionString))
                //{
                rowsAffected = db.Insert(cup);
                //}

                if (rowsAffected > 0)
                {
                    Logger.Out("Cup: " + cup.entry_1_name + " v " + cup.entry_2_name + " - inserted");
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Logger.Error("Cup Repository (insert) error: " + ex.Message);
                throw ex;
            }
        }