public async Task WhenAsync(CreatePhysicalInventoryLineMvoDto c) { var idObj = PhysicalInventoryLineMvoProxyUtils.ToIdString((c as ICreatePhysicalInventoryLineMvo).PhysicalInventoryLineId); var uriParameters = new PhysicalInventoryLineMvoUriParameters(); uriParameters.Id = idObj; var req = new PhysicalInventoryLineMvoPutRequest(uriParameters, (CreatePhysicalInventoryLineMvoDto)c); var resp = await _ramlClient.PhysicalInventoryLineMvo.Put(req); PhysicalInventoryLineMvoProxyUtils.ThrowOnHttpResponseError(resp); }
public HttpResponseMessage Post([FromBody] CreatePhysicalInventoryLineMvoDto value) { try { if (value.PhysicalInventoryLineId == default(PhysicalInventoryLineId)) { throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "PhysicalInventoryLineMvo"); } _physicalInventoryLineMvoApplicationService.When(value as ICreatePhysicalInventoryLineMvo); var idObj = value.PhysicalInventoryLineId; return(Request.CreateResponse <PhysicalInventoryLineId>(HttpStatusCode.Created, idObj)); } catch (Exception ex) { var response = PhysicalInventoryLineMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void When(CreatePhysicalInventoryLineMvoDto c) { WhenAsync(c).GetAwaiter().GetResult(); }