public async Task WhenAsync(CreatePickwaveDto c)
        {
            var idObj         = (c as ICreatePickwave).PickwaveId;
            var uriParameters = new PickwaveUriParameters();

            uriParameters.Id = idObj;

            var req = new PickwavePutRequest(uriParameters, (CreatePickwaveDto)c);

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

            PickwaveProxyUtils.ThrowOnHttpResponseError(resp);
        }
Exemple #2
0
        public HttpResponseMessage Post([FromBody] CreatePickwaveDto value)
        {
            try {
                if (value.PickwaveId == default(long?))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "Pickwave");
                }
                _pickwaveApplicationService.When(value as ICreatePickwave);
                var idObj = value.PickwaveId;

                return(Request.CreateResponse <long?>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = PickwavesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
 public void When(CreatePickwaveDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }