コード例 #1
0
        public static async Task <GrpcShipmentList> SearchShipments(GrpcShipmentSearchRequest grpcRequest)
        {
            try
            {
                var req  = GrpcShipmentSearchRequestAdapter.Adapt(grpcRequest);
                var resp = await ShipmentUseCases.Search.Execute(req);

                return(ShipmentListPresenter.Present(resp));
            }
            catch (Exception e)
            {
                throw;
            }
        }
コード例 #2
0
        public async Task <IActionResult> SearchShipments(ShipmentSearch search)
        {
            try
            {
                var req  = GrpcShipmentSearchRequestFactory.GetFrom(search);
                var resp = await ShippingClient.SearchShipments(req);

                return(new ContentResult()
                {
                    Content = ShipmentListPresenter.GetSerializedFrom(resp),
                    ContentType = "application/json"
                });
            }
            catch (Exception e)
            {
                throw;
            }
        }