Alexu
Alexu

Reputation: 1205

gRPC for .Net CORE - how to convert C# [DataContract] classes into messages of .proto file

We have an existing .Net system under WCF which we need to convert to gRPC under .Net CORE. One challenge I am facing now it to convert all our entity classes (the [DataContract] classes that will be shared between client and server side) to messages of .proto files. The problem here is that the number of those classes is huge, and a lot of them are quite complex. I can't imagine that we have to convert them manually one by one. So my question is - what's the best way to convert them? is there any tools available? or, is it a good idea to convert them at all? If not, what's best way to handle those classes.

Upvotes: 0

Views: 2343

Answers (1)

D M
D M

Reputation: 7189

This guide (archive) mentions using protobuf-net.Grpc (archive) which looks like less work.

It involves some changes to your DataContracts and some filler code between your existing WCF contract and a new ASP.NET contract using gRPC.

Upvotes: 2

Related Questions