public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteDocumentTypeDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); DocumentTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _documentTypeApplicationService.When(value as IDeleteDocumentType); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(DeleteDocumentTypeDto c) { var idObj = (c as IDeleteDocumentType).DocumentTypeId; var uriParameters = new DocumentTypeUriParameters(); uriParameters.Id = idObj; var q = new DocumentTypeDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new DocumentTypeDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.DocumentType.Delete(req); DocumentTypeProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(DeleteDocumentTypeDto c) { WhenAsync(c).GetAwaiter().GetResult(); }