Exemple #1
0
        public HttpResponseMessage Post([FromBody] CreateOrderItemShipGrpInvReservationDto value)
        {
            try {
                if (value.OrderItemShipGrpInvResId == default(OrderItemShipGrpInvResId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "OrderItemShipGrpInvReservation");
                }
                _orderItemShipGrpInvReservationApplicationService.When(value as ICreateOrderItemShipGrpInvReservation);
                var idObj = value.OrderItemShipGrpInvResId;

                return(Request.CreateResponse <OrderItemShipGrpInvResId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = OrderItemShipGrpInvReservationsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
        public async Task WhenAsync(CreateOrderItemShipGrpInvReservationDto c)
        {
            var idObj         = OrderItemShipGrpInvReservationProxyUtils.ToIdString((c as ICreateOrderItemShipGrpInvReservation).OrderItemShipGrpInvResId);
            var uriParameters = new OrderItemShipGrpInvReservationUriParameters();

            uriParameters.Id = idObj;

            var req = new OrderItemShipGrpInvReservationPutRequest(uriParameters, (CreateOrderItemShipGrpInvReservationDto)c);

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

            OrderItemShipGrpInvReservationProxyUtils.ThrowOnHttpResponseError(resp);
        }
 public void When(CreateOrderItemShipGrpInvReservationDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }