public async Task <ActionResult> DeleteAsync([FromRoute] int _salesOrderId) { ActionResult response; try { if (ModelState.IsValid) { Output output = await svc.DeleteAsync(_salesOrderId); response = StatusCode((int)output.HttpStatus, output); return(response); } else { currentErrors.AddModelErrors(ModelState); } } catch (Exception ex) { currentErrors.MergeWith(errorsParser.FromException(ex)); } response = StatusCode((int)currentErrors.HttpStatus, new Output(currentErrors)); return(response); }