public HttpResponseMessage Post([FromBody] CreatePartyRoleDto value)
        {
            try {
                if (value.PartyRoleId == default(PartyRoleId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "PartyRole");
                }
                _partyRoleApplicationService.When(value as ICreatePartyRole);
                var idObj = value.PartyRoleId;

                return(Request.CreateResponse <PartyRoleId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
        public async Task WhenAsync(CreatePartyRoleDto c)
        {
            var idObj         = PartyRoleProxyUtils.ToIdString((c as ICreatePartyRole).PartyRoleId);
            var uriParameters = new PartyRoleUriParameters();

            uriParameters.Id = idObj;

            var req = new PartyRolePutRequest(uriParameters, (CreatePartyRoleDto)c);

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

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