コード例 #1
0
        public IActionResult OnPostAsync(int id)
        {
            TeamCollection teamCollection = new TeamCollection();

            try
            {
                teamCollection.UpdateTeam(DisplayTeam, id);
            }
            catch (MySqlException e)
            {
                var code = e.ErrorCode;
                if (code == -2147467259)
                {
                    return(RedirectToPage("/DatabaseConnectionError"));
                }
                else
                {
                    return(RedirectToPage("/Error"));
                }
            }
            finally
            {
            }
            return(RedirectToPage("/Team"));
        }