Ejemplo n.º 1
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeletePartyRoleDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         PartyRolesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _partyRoleApplicationService.When(value as IDeletePartyRole);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
        public async Task WhenAsync(DeletePartyRoleDto c)
        {
            var idObj         = PartyRoleProxyUtils.ToIdString((c as IDeletePartyRole).PartyRoleId);
            var uriParameters = new PartyRoleUriParameters();

            uriParameters.Id = idObj;

            var q = new PartyRoleDeleteQuery();

            q.CommandId   = c.CommandId;
            q.RequesterId = c.RequesterId;
            q.Version     = Convert.ToString(c.Version);

            var req = new PartyRoleDeleteRequest(uriParameters);

            req.Query = q;

            var resp = await _ramlClient.PartyRole.Delete(req);

            PartyRoleProxyUtils.ThrowOnHttpResponseError(resp);
        }
 public void When(DeletePartyRoleDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }