Example #1
0
        private async Task <GenericRecord> RunGenericClient(GenericClient client, CancellationToken token)
        {
            var parameterType         = client.Protocol.Types.First(r => r.Name == "Greeting") as RecordSchema;
            var parameterRecordSchema = new RecordSchema(
                "hello",
                $"{client.Protocol.Namespace}.messages",
                new RecordSchema.Field[]
            {
                new RecordSchema.Field("greeting", parameterType)
            }
                );
            var parameter = new GenericRecord(parameterType);

            parameter[0] = "Hello!";
            var parameterRecord = new GenericRecord(parameterRecordSchema);

            parameterRecord[0] = parameter;
            var rpcContext = await client.RequestAsync("hello", parameterRecord, token);

            return(rpcContext.Response as GenericRecord);
        }