Esempio n. 1
0
        public async Task WhenAsync(CreateGoodIdentificationMvoDto c)
        {
            var idObj         = GoodIdentificationMvoProxyUtils.ToIdString((c as ICreateGoodIdentificationMvo).ProductGoodIdentificationId);
            var uriParameters = new GoodIdentificationMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new GoodIdentificationMvoPutRequest(uriParameters, (CreateGoodIdentificationMvoDto)c);

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

            GoodIdentificationMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public HttpResponseMessage Post([FromBody] CreateGoodIdentificationMvoDto value)
        {
            try {
                if (value.ProductGoodIdentificationId == default(ProductGoodIdentificationId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "GoodIdentificationMvo");
                }
                _goodIdentificationMvoApplicationService.When(value as ICreateGoodIdentificationMvo);
                var idObj = value.ProductGoodIdentificationId;

                return(Request.CreateResponse <ProductGoodIdentificationId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = GoodIdentificationMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Esempio n. 3
0
 public void When(CreateGoodIdentificationMvoDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }