public async Task <ActionResult> DeleteLineItemAsync([Required] string contextId, [Required] string lineItemId) { try { _logger.LogDebug($"Entering {nameof(DeleteLineItemAsync)}."); try { var request = new DeleteLineItemRequest(contextId, lineItemId); return(await OnDeleteLineItemAsync(request).ConfigureAwait(false)); } catch (Exception ex) { _logger.LogError(ex, $"An unexpected error occurred in {nameof(DeleteLineItemAsync)}."); return(StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetails { Title = "An unexpected error occurred", Status = StatusCodes.Status500InternalServerError, Detail = _env.IsDevelopment() ? ex.Message + ex.StackTrace : ex.Message })); } } finally { _logger.LogDebug($"Entering {nameof(DeleteLineItemAsync)}."); } }
/// <summary> /// Deletes a line item. /// </summary> /// <param name="request">The request parameters.</param> /// <returns>The result.</returns> protected abstract Task <ActionResult> OnDeleteLineItemAsync(DeleteLineItemRequest request);