/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> public static void BindService(grpc::ServiceBinderBase serviceBinder, PayloadServiceBase serviceImpl) { serviceBinder.AddMethod(__Method_GetSmallPayload, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PayloadId, global::GrpcServer.SmallPayload>(serviceImpl.GetSmallPayload)); serviceBinder.AddMethod(__Method_GetMediumPayload, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PayloadId, global::GrpcServer.MediumPayload>(serviceImpl.GetMediumPayload)); serviceBinder.AddMethod(__Method_GetLargePayload, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PayloadId, global::GrpcServer.LargePayload>(serviceImpl.GetLargePayload)); serviceBinder.AddMethod(__Method_GetAllSmallPayloads, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::GrpcServer.EmptyRequest, global::GrpcServer.SmallPayload>(serviceImpl.GetAllSmallPayloads)); serviceBinder.AddMethod(__Method_GetAllMediumPayloads, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::GrpcServer.EmptyRequest, global::GrpcServer.MediumPayload>(serviceImpl.GetAllMediumPayloads)); serviceBinder.AddMethod(__Method_GetAllLargePayloads, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::GrpcServer.EmptyRequest, global::GrpcServer.LargePayload>(serviceImpl.GetAllLargePayloads)); serviceBinder.AddMethod(__Method_GetDeepPayload, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PayloadId, global::GrpcServer.DeepPayload>(serviceImpl.GetDeepPayload)); serviceBinder.AddMethod(__Method_GetDeeperPayload, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PayloadId, global::GrpcServer.DeeperPayload>(serviceImpl.GetDeeperPayload)); serviceBinder.AddMethod(__Method_GetDeepestPayload, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PayloadId, global::GrpcServer.DeepestPayload>(serviceImpl.GetDeepestPayload)); serviceBinder.AddMethod(__Method_GetAllDeepPayloads, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::GrpcServer.EmptyRequest, global::GrpcServer.DeepPayload>(serviceImpl.GetAllDeepPayloads)); serviceBinder.AddMethod(__Method_GetAllDeeperPayloads, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::GrpcServer.EmptyRequest, global::GrpcServer.DeeperPayload>(serviceImpl.GetAllDeeperPayloads)); serviceBinder.AddMethod(__Method_GetAllDeepestPayloads, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::GrpcServer.EmptyRequest, global::GrpcServer.DeepestPayload>(serviceImpl.GetAllDeepestPayloads)); }
/// <summary>Creates service definition that can be registered with a server</summary> /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> public static grpc::ServerServiceDefinition BindService(PayloadServiceBase serviceImpl) { return(grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_GetSmallPayload, serviceImpl.GetSmallPayload) .AddMethod(__Method_GetMediumPayload, serviceImpl.GetMediumPayload) .AddMethod(__Method_GetLargePayload, serviceImpl.GetLargePayload) .AddMethod(__Method_GetAllSmallPayloads, serviceImpl.GetAllSmallPayloads) .AddMethod(__Method_GetAllMediumPayloads, serviceImpl.GetAllMediumPayloads) .AddMethod(__Method_GetAllLargePayloads, serviceImpl.GetAllLargePayloads) .AddMethod(__Method_GetDeepPayload, serviceImpl.GetDeepPayload) .AddMethod(__Method_GetDeeperPayload, serviceImpl.GetDeeperPayload) .AddMethod(__Method_GetDeepestPayload, serviceImpl.GetDeepestPayload) .AddMethod(__Method_GetAllDeepPayloads, serviceImpl.GetAllDeepPayloads) .AddMethod(__Method_GetAllDeeperPayloads, serviceImpl.GetAllDeeperPayloads) .AddMethod(__Method_GetAllDeepestPayloads, serviceImpl.GetAllDeepestPayloads).Build()); }