Пример #1
0
        public void DeleteById_Test()
        {
            Sponsor sponsors = _sponsorService.Get(1);

            _sponsorService.Delete(1);

            Sponsor sponsorsDefault = _sponsorService.Get(1);

            Assert.IsNull(sponsorsDefault, "Delete is not a success");
        }
        public ActionResult Delete(int id, SponsorsViewModel model)
        {
            Sponsors sponsorToDelete = new Sponsors();

            sponsorToDelete = sponsorService.GetSponsorById(id);
            model.InjectFrom(sponsorToDelete);
            sponsorService.Delete(sponsorToDelete);
            sponsorService.Save();
            return(RedirectToAction(nameof(Index)));
        }
 public HttpResponseMessage Delete(int id)
 {
     _service.Delete(id);
     return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse()));
 }