public async Task <IActionResult> Delete(long id) { try { if (id <= 0) { return(BadRequest("Invalid id.")); } await _customerFacade.DeleteAsync(id); return(NoContent()); } catch (EntityNotFoundException e) { _logger.LogError( "Exception Details: {message}, {innerException}, {stackTrace}. CorrelationId: {correlationId}", e.Message, e.InnerException?.Message, e.StackTrace, _correlationContext.CorrelationContext.CorrelationId); return(NotFound()); } catch (ValidationException e) { _logger.LogError( "Exception Details: {message}, {innerException}, {stackTrace}. CorrelationId: {correlationId}", e.Message, e.InnerException?.Message, e.StackTrace, _correlationContext.CorrelationContext.CorrelationId); return(BadRequest(e.Message)); } }