public async Task WhenAsync(CreatePhysicalInventoryDto c)
        {
            var idObj         = (c as ICreatePhysicalInventory).DocumentNumber;
            var uriParameters = new PhysicalInventoryUriParameters();

            uriParameters.Id = idObj;

            var req = new PhysicalInventoryPutRequest(uriParameters, (CreatePhysicalInventoryDto)c);

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

            PhysicalInventoryProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public HttpResponseMessage Post([FromBody] CreatePhysicalInventoryDto value)
        {
            try {
                if (value.DocumentNumber == default(string))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "PhysicalInventory");
                }
                _physicalInventoryApplicationService.When(value as ICreatePhysicalInventory);
                var idObj = value.DocumentNumber;

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