Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Created December 28, 2019 05:04
Show Gist options
  • Save gistlyn/0175850e06bfc8af5bd24c24e5f5fc2a to your computer and use it in GitHub Desktop.
Save gistlyn/0175850e06bfc8af5bd24c24e5f5fc2a to your computer and use it in GitHub Desktop.
ServiceStack VB.NET gRPC Generic ServiceClient TodoWorld Example
Imports System
Imports System.Collections.Generic
Imports System.Threading.Tasks
Imports System.Security.Cryptography.X509Certificates
Imports ServiceStack
Imports TodoWorld.ServiceModel
Module Program
Async Function Todo() As Task
Dim client = new GrpcServiceClient("https://todoworld.servicestack.net:50051",
new X509Certificate2("https://todoworld.servicestack.net/grpc.crt".GetBytesFromUrl()),
GrpcUtils.AllowSelfSignedCertificatesFrom("todoworld.servicestack.net"))
Dim response = Await client.GetAsync(New Hello With { .Name = "gRPC VB.NET" })
Console.WriteLine(response.Result)
End Function
Sub Main(args As String())
Task.WaitAll(Todo())
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment