Esempio n. 1
0
        public HttpResponseMessage Post([FromBody] CreateItemIssuanceMvoDto value)
        {
            try {
                if (value.ShipmentItemIssuanceId == default(ShipmentItemIssuanceId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "ItemIssuanceMvo");
                }
                _itemIssuanceMvoApplicationService.When(value as ICreateItemIssuanceMvo);
                var idObj = value.ShipmentItemIssuanceId;

                return(Request.CreateResponse <ShipmentItemIssuanceId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = ItemIssuanceMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Esempio n. 2
0
        public async Task WhenAsync(CreateItemIssuanceMvoDto c)
        {
            var idObj         = ItemIssuanceMvoProxyUtils.ToIdString((c as ICreateItemIssuanceMvo).ShipmentItemIssuanceId);
            var uriParameters = new ItemIssuanceMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new ItemIssuanceMvoPutRequest(uriParameters, (CreateItemIssuanceMvoDto)c);

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

            ItemIssuanceMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Esempio n. 3
0
 public void When(CreateItemIssuanceMvoDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }