public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteRoleTypeDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); RoleTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _roleTypeApplicationService.When(value as IDeleteRoleType); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(DeleteRoleTypeDto c) { var idObj = (c as IDeleteRoleType).RoleTypeId; var uriParameters = new RoleTypeUriParameters(); uriParameters.Id = idObj; var q = new RoleTypeDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new RoleTypeDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.RoleType.Delete(req); RoleTypeProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(DeleteRoleTypeDto c) { WhenAsync(c).GetAwaiter().GetResult(); }