public static async Task <GrpcShipment> GetShipmentById(GrpcString grpcRequest) { try { var id = GrpcStringAdapter.GetFrom(grpcRequest); var shipment = await ShipmentUseCases.Get.ById(id); return(ShipmentPresenter.Present(shipment)); } catch (Exception e) { throw; } }
public async Task <IActionResult> GetShipment(string id) { try { var req = new GrpcString() { Value = id }; var shipment = await ShippingClient.GetShipmentById(req); return(new ContentResult() { Content = ShipmentPresenter.PresentSerialized(shipment), ContentType = "application/json" }); } catch (Exception e) { throw; } }