コード例 #1
0
        public void ShouldDeleteMission()
        {
            Response aResponse = new Response();

            missionRepo.Insert(MISSION1);
            missionRepo.Insert(MISSION2);
            aResponse = missionRepo.Delete(1);

            Assert.IsTrue(aResponse.Success);
        }
コード例 #2
0
        public string Delete(int Id, string CurrentUsername)
        {
            Mission mission = FindById(Id, CurrentUsername);

            if (mission != null)
            {
                return(MissionRepository.Delete(Id) ? null : Messages.IssueInDatabase);
            }
            else
            {
                return(Messages.NotFound);
            }
        }
コード例 #3
0
        public IActionResult Delete(int id)
        {
            _missonRepository.Delete(_missonRepository.Find(id));

            return(RedirectToAction("Index", "Mission"));
        }