Esempio n. 1
0
        private static void AddShowContests(Show show)
        {
            ShowContestRepo showContestRepo = new ShowContestRepo();

            //foreach (Contest contest in show.Contests)
            //showContestRepo.Add(new ShowContest(show.Id, contest.Id));
        }
Esempio n. 2
0
        public override void Delete(int id)
        {
            var showContestRepo       = new ShowContestRepo();
            var showContestCollection = showContestRepo.GetWhereForeignKeyIs(id);
            var contestRepo           = new ContestRepo();

            foreach (var sc in showContestCollection)
            {
                contestRepo.Delete(sc.ContestId);
                showContestRepo.Delete(sc.Id);
            }

            base.Delete(id);
        }