icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
102 stars 13 forks source link

New discriminated union example #3885

Closed bernardnormier closed 7 months ago

bernardnormier commented 7 months ago

This PR adds a new discriminated union example.

bernardnormier commented 7 months ago

For reference, the output is:

Client

The area of Rectangle { Width = 3, Height = 2 } is 6.00
The area of Ellipse { MajorAxis = 3, MinorAxis = 2 } is 4.71
The area of Square { Side = 4 } is 16.00
The area of Circle { Radius = 2 } is 12.57

Server

Computing area for shape Rectangle { Width = 3, Height = 2 }
Computing area for shape Ellipse { MajorAxis = 3, MinorAxis = 2 }
Computing area for shape Square { Side = 4 }
Computing area for shape Circle { Radius = 2 }