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); } }
public void When(CreateGoodIdentificationMvoDto c) { WhenAsync(c).GetAwaiter().GetResult(); }