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; } }
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; } }