public async Task <IActionResult> Delete(int invoiceId, int Id) { try { var Estimate = await _repository.GetEstimateAsync(invoiceId, Id); if (Estimate == null) { return(NotFound()); } if (await _repository.DeleteEstimate(Estimate)) { return(Ok()); } } catch (Exception e) { _logger.LogError(e, e.Message); return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure")); } return(BadRequest("Failed to delete the Estimate")); }
public object DeleteEstimate(Guid id) { return(_estimateRepository.DeleteEstimate(id)); }