public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteShipmentMethodTypeDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); ShipmentMethodTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentMethodTypeApplicationService.When(value as IDeleteShipmentMethodType); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(DeleteShipmentMethodTypeDto c) { var idObj = (c as IDeleteShipmentMethodType).ShipmentMethodTypeId; var uriParameters = new ShipmentMethodTypeUriParameters(); uriParameters.Id = idObj; var q = new ShipmentMethodTypeDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new ShipmentMethodTypeDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.ShipmentMethodType.Delete(req); ShipmentMethodTypeProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(DeleteShipmentMethodTypeDto c) { WhenAsync(c).GetAwaiter().GetResult(); }