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