ActivEarth.DAO.TeamDAO.RemoveTeam C# (CSharp) Метод

RemoveTeam() публичный статический Метод

Removes an existing Team from the DB.
public static RemoveTeam ( int teamId ) : bool
teamId int
Результат bool
        public static bool RemoveTeam(int teamId)
        {
            try
            {
                TeamDAO.RemoveTeamMembersFromTeamId(teamId);

                using (SqlConnection connection = ConnectionManager.GetConnection())
                {
                    var data = new ActivEarthDataProvidersDataContext(connection);
                    TeamDataProvider dbTeam =
                        (from c in data.TeamDataProviders where c.id == teamId select c).FirstOrDefault();
                    if (dbTeam != null)
                    {
                        data.TeamDataProviders.DeleteOnSubmit(dbTeam);
                        data.SubmitChanges();
                    }

                    return true;
                }
            }
            catch (Exception)
            {
                return false;
            }
        }