public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteRejectionReasonDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); RejectionReasonsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _rejectionReasonApplicationService.When(value as IDeleteRejectionReason); } catch (Exception ex) { var response = RejectionReasonsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(DeleteRejectionReasonDto c) { var idObj = (c as IDeleteRejectionReason).RejectionReasonId; var uriParameters = new RejectionReasonUriParameters(); uriParameters.Id = idObj; var q = new RejectionReasonDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new RejectionReasonDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.RejectionReason.Delete(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(DeleteRejectionReasonDto c) { WhenAsync(c).GetAwaiter().GetResult(); }