コード例 #1
0
        public static async Task <GrpcShipmentEvents> GetShipmentEvents(GrpcString grpcRequest)
        {
            try
            {
                var id       = GrpcStringAdapter.GetFrom(grpcRequest);
                var shipment = await ShipmentUseCases.Get.ById(id);

                return(ShipmentEventsPresenter.Present(shipment));
            }
            catch (Exception e)
            {
                throw;
            }
        }
コード例 #2
0
        public async Task <IActionResult> GetShipmentEvents(string id)
        {
            try
            {
                var req = new GrpcString()
                {
                    Value = id
                };
                var events = await ShippingClient.GetShipmentEvents(req);

                return(new ContentResult()
                {
                    Content = ShipmentEventsPresenter.PresentSerialized(events),
                    ContentType = "application/json"
                });
            }
            catch (Exception e)
            {
                throw;
            }
        }