예제 #1
0
 public void Put(string id, [FromBody] CreateInOutLineMvoDto value)
 {
     try {
         InOutLineMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _inOutLineMvoApplicationService.When(value as ICreateInOutLineMvo);
     } catch (Exception ex) { var response = InOutLineMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
예제 #2
0
        public async Task WhenAsync(CreateInOutLineMvoDto c)
        {
            var idObj         = InOutLineMvoProxyUtils.ToIdString((c as ICreateInOutLineMvo).InOutLineId);
            var uriParameters = new InOutLineMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new InOutLineMvoPutRequest(uriParameters, (CreateInOutLineMvoDto)c);

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

            InOutLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
예제 #3
0
        public HttpResponseMessage Post([FromBody] CreateInOutLineMvoDto value)
        {
            try {
                if (value.InOutLineId == default(InOutLineId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "InOutLineMvo");
                }
                _inOutLineMvoApplicationService.When(value as ICreateInOutLineMvo);
                var idObj = value.InOutLineId;

                return(Request.CreateResponse <InOutLineId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = InOutLineMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
예제 #4
0
 public void When(CreateInOutLineMvoDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }