I've been experimenting with the NuGet package FSharp.GrpcCodeGenerator in converting my proto files to F# types.
On my client side (in F#), I have:
namespace StargateIX.Network
open System
open Grpc.Core
open Protocol.ProtoBuf
open Grpc.Net.Client
module ClientNetwork =
let channel = GrpcChannel.ForAddress("https://localhost:5001/")
let client = PatientService.PatientServiceClient(channel)
let req = GetAllPatientsRequest.empty()
let resp = client.GetAllPatients(req).Patients
?????????????
printfn "%s" resp.Message
Where GetAllPatientsRequest is an empty message, i.e.
message GetAllPatientsRequest {}
and the reponse to GetAllPatients is
message PatientListResponse {
repeated Patient Patients = 1;
}
How do I convert the PatientListResponse with its repeated field to a standard F# Array or list such that I can print it?
(Also, all this should be done asynchronously).
message Patient {
int32 PatientId =1;
google.protobuf.Timestamp BirthDate = 2;
string FirstName =3;
string LastName=4;
google.protobuf.StringValue Mi=5;
int32 ChartNumber=6;
}
TIA