public JsonResult DeleteCoupon(int id) { _couponRepository.Delete(id); return(Json(new { valid = true, Message = "Coupon was deleted succesfully", redirect = "/Coupon/AdminIndex" })); }
public ActionResult Delete(CouponsDTO entity) { Coupons c = Mapper.Map <CouponsDTO, Coupons>(entity); couponRepository.Delete(c); return(Json(entity, JsonRequestBehavior.AllowGet)); }
public IActionResult Delete(int id) { var coupon = _coupon.Find(id); _coupon.Delete(coupon); return(RedirectToAction(nameof(Index))); }
public async Task <CouponDto> DeleteById(Guid id) { var modelToDelete = await _couponRepository.FindByCondition(x => x.Id == id); if (!modelToDelete.Any()) { throw new ApiException("No se pudo Eliminar el cupon ", HttpStatusCode.NotFound); } _couponRepository.Delete(modelToDelete.FirstOrDefault()); return(_mapper.Map <CouponDto>(modelToDelete.FirstOrDefault())); }
public async Task <ActionsResult> Delete(int id) { return(await couponRepository.Delete(id)); }
public bool DeleteCoupon(CouponDto couponDto) { var entity = _dtoMapper.Map(couponDto); return(_couponRepository.Delete(entity)); }