コード例 #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();
            }
        }
コード例 #2
0
        public ActionResult Remove(RemoveLeagueCommand command)
        {
            HandleCommand(command, Json("League removed"));

            return(RedirectToAction("Index"));
        }