public HttpResponseMessage Post([FromBody] CreateInventoryItemEntryMvoDto value) { try { if (value.InventoryItemEntryId == default(InventoryItemEntryId)) { throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "InventoryItemEntryMvo"); } _inventoryItemEntryMvoApplicationService.When(value as ICreateInventoryItemEntryMvo); var idObj = value.InventoryItemEntryId; return(Request.CreateResponse <InventoryItemEntryId>(HttpStatusCode.Created, idObj)); } catch (Exception ex) { var response = InventoryItemEntryMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(CreateInventoryItemEntryMvoDto c) { var idObj = InventoryItemEntryMvoProxyUtils.ToIdString((c as ICreateInventoryItemEntryMvo).InventoryItemEntryId); var uriParameters = new InventoryItemEntryMvoUriParameters(); uriParameters.Id = idObj; var req = new InventoryItemEntryMvoPutRequest(uriParameters, (CreateInventoryItemEntryMvoDto)c); var resp = await _ramlClient.InventoryItemEntryMvo.Put(req); InventoryItemEntryMvoProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(CreateInventoryItemEntryMvoDto c) { WhenAsync(c).GetAwaiter().GetResult(); }