Esempio n. 1
0
        public void Handle(RemoveLeagueCommand command)
        {
            // TODO validate

            using (var dbContext = new ManagementDataContext())
            {
                League league = dbContext.Leagues.FirstOrDefault(l => l.OrganizerId == command.Id);

                dbContext.Leagues.Remove(league);
                dbContext.SaveChanges();
            }
        }
Esempio n. 2
0
        public ActionResult Remove(RemoveLeagueCommand command)
        {
            HandleCommand(command, Json("League removed"));

            return(RedirectToAction("Index"));
        }