public ActionResult Delete(long id) { try { var data = repository.Delete(id); return(Ok(new { success = true, succssMessage = "Deleted Successfully!" })); } catch (Exception ex) { return(Ok(new { success = false, errorMessage = ex.GetBaseException() })); } }
public async Task <IActionResult> ExecuteAsync(int paymentMethodId, CancellationToken cancellationToken) { var paymentMethod = await _paymentMethodRepository.Get(paymentMethodId, cancellationToken); if (paymentMethod == null) { return(new NotFoundResult()); } await _paymentMethodRepository.Delete(paymentMethod, cancellationToken); return(new NoContentResult()); }
/// <summary> /// Method whose purpose is to delete /// an existing PaymentMethod record. /// </summary> /// <param name="paymentMethod"> /// Existing PaymentMethodModel object. /// </param> /// <returns> /// Returns true if the query is successfully executed /// otherwise returns false. /// </returns> public bool Delete(PaymentMethodModel paymentMethod) { return(_paymentMethodRepository.Delete(paymentMethod) > 0 ? true : false); }
public void Delete(PaymentMethod entity) { _PaymentMethodRepository.Delete(entity); }