public static SomeObjectProto CopyToProto(SomeObject value) { var result = new SomeObjectProto { DateScalar = Google.Protobuf.WellKnownTypes.Timestamp.FromDateTime(value.DateScalar), Int32Scalar = value.Int32Scalar, SingleScalar = value.SingleScalar }; if (value.StringScalar != null) { result.StringScalar = value.StringScalar; } if (value.SingleArray != null) { result.SingleArray.Add(value.SingleArray); } if (value.Int32Array != null) { result.Int32Array.Add(value.Int32Array); } if (value.DoubleArray != null) { result.DoubleArray.Add(value.DoubleArray); } return(result); }
public NativeGrpcClientCallTest(SomeObject payload) { _payload = DomainExtensions.CopyToProto(payload); _httpHandler = new StubHttpMessageHandler(_payload); _channel = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions { HttpHandler = _httpHandler }); _proxy = new TestServiceNative.TestServiceNativeClient(_channel); }
public NativeGrpcCombinedCallTest(SomeObject payload) { _payload = DomainExtensions.CopyToProto(payload); _server = new TestServer(new WebHostBuilder().UseStartup <Startup>()); _client = _server.CreateClient(); _channel = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions { HttpClient = _client }); _proxy = new TestServiceNative.TestServiceNativeClient(_channel); }
public ServiceModelGrpcProtoClientCallTest(SomeObject payload) { _payload = DomainExtensions.CopyToProto(payload); _httpHandler = new StubHttpMessageHandler(GoogleProtoMarshallerFactory.Default, new Message <SomeObjectProto>(_payload)); _channel = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions { HttpHandler = _httpHandler }); var clientFactory = new ClientFactory(new ServiceModelGrpcClientOptions { MarshallerFactory = GoogleProtoMarshallerFactory.Default }); _proxy = clientFactory.CreateClient <ITestService>(_channel); }
public ServiceModelGrpcProtoCombinedCallTest(SomeObject payload) { _payload = DomainExtensions.CopyToProto(payload); var builder = new WebHostBuilder().UseStartup <Startup>(); _server = new TestServer(builder); _client = _server.CreateClient(); _channel = GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions { HttpClient = _client }); _clientFactory = new ClientFactory(new ServiceModelGrpcClientOptions { MarshallerFactory = GoogleProtoMarshallerFactory.Default }); _proxy = _clientFactory.CreateClient <ITestService>(_channel); }
public override Task <SomeObjectProto> PingPong(SomeObjectProto request, ServerCallContext context) { return(Task.FromResult(request)); }
public Task <SomeObjectProto> PingPongProto(SomeObjectProto value) { return(Task.FromResult(value)); }