public HttpResponseMessage Delete(int id)
        {
            _testimonial.Delete(id);

            SuccessResponse response = new SuccessResponse();

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Пример #2
0
        public ActionResult DeletePost(Guid id)
        {
            try
            {
                var eventEntity = _testimonialService.FindBy(x => x.Id == id).Single();
                _testimonialService.Delete(eventEntity);
                _testimonialService.Save();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Пример #3
0
        public ActionResult Delete(TestimonialViewModel viewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var entity = Mapper.Map <TestimonialViewModel, Testimonial>(viewModel);

                    _testimonialService.Delete(entity);

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
            }

            return(View(viewModel));
        }
Пример #4
0
 public IActionResult Delete(int id)
 {
     _testimonialService.Delete(id);
     return(RedirectToAction("Index"));
 }
Пример #5
0
 public void Delete(long tenantId, long elementId, IUnitOfWork unitOfWork = null)
 {
     _testimonialService.Delete(tenantId, elementId, unitOfWork);
 }