示例#1
0
        public void UpdateTown(Towns town)
        {
            var item = olympicGamesDBContext.Towns.Find(town.Id);

            if (item != null)
            {
                olympicGamesDBContext.Entry(item).CurrentValues.SetValues(town);
                olympicGamesDBContext.SaveChanges();
            }
        }
示例#2
0
        /// <summary>
        /// Updates a club in the database.
        /// </summary>
        /// <param name="club">The club that is being updated.</param>
        public void UpdateClub(Clubs club)
        {
            var item = olympicGamesDBContext.Clubs.Find(club.Id);

            if (item != null)
            {
                olympicGamesDBContext.Entry(item).CurrentValues.SetValues(club);
                olympicGamesDBContext.SaveChanges();
            }
        }
示例#3
0
        /// <summary>
        /// Updates a coach in the database.
        /// </summary>
        /// <param name="coach">The coach that is being updated.</param>
        public void UpdateCoach(Coaches coach)
        {
            var item = olympicGamesDBContext.Coaches.Find(coach.Id);

            if (item != null)
            {
                olympicGamesDBContext.Entry(item).CurrentValues.SetValues(coach);
                olympicGamesDBContext.SaveChanges();
            }
        }
示例#4
0
        /// <summary>
        /// Updates a competitor in the database.
        /// </summary>
        /// <param name="competitor">The competitor that is being updated.</param>
        public void UpdateCompetitor(Competitors competitor)
        {
            var item = olympicGamesDBContext.Competitors.Find(competitor.Id);

            if (item != null)
            {
                olympicGamesDBContext.Entry(item).CurrentValues.SetValues(competitor);
                olympicGamesDBContext.SaveChanges();
            }
        }