Beispiel #1
0
 /// <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, DatastoreBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_Lookup, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Datastore.V1.LookupRequest, global::Google.Cloud.Datastore.V1.LookupResponse>(serviceImpl.Lookup));
     serviceBinder.AddMethod(__Method_RunQuery, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Datastore.V1.RunQueryRequest, global::Google.Cloud.Datastore.V1.RunQueryResponse>(serviceImpl.RunQuery));
     serviceBinder.AddMethod(__Method_BeginTransaction, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Datastore.V1.BeginTransactionRequest, global::Google.Cloud.Datastore.V1.BeginTransactionResponse>(serviceImpl.BeginTransaction));
     serviceBinder.AddMethod(__Method_Commit, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Datastore.V1.CommitRequest, global::Google.Cloud.Datastore.V1.CommitResponse>(serviceImpl.Commit));
     serviceBinder.AddMethod(__Method_Rollback, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Datastore.V1.RollbackRequest, global::Google.Cloud.Datastore.V1.RollbackResponse>(serviceImpl.Rollback));
     serviceBinder.AddMethod(__Method_AllocateIds, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Datastore.V1.AllocateIdsRequest, global::Google.Cloud.Datastore.V1.AllocateIdsResponse>(serviceImpl.AllocateIds));
     serviceBinder.AddMethod(__Method_ReserveIds, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Cloud.Datastore.V1.ReserveIdsRequest, global::Google.Cloud.Datastore.V1.ReserveIdsResponse>(serviceImpl.ReserveIds));
 }
Beispiel #2
0
 /// <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 ServerServiceDefinition BindService(DatastoreBase serviceImpl)
 {
     return(ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Lookup, serviceImpl.Lookup)
            .AddMethod(__Method_RunQuery, serviceImpl.RunQuery)
            .AddMethod(__Method_BeginTransaction, serviceImpl.BeginTransaction)
            .AddMethod(__Method_Commit, serviceImpl.Commit)
            .AddMethod(__Method_Rollback, serviceImpl.Rollback)
            .AddMethod(__Method_AllocateIds, serviceImpl.AllocateIds).Build());
 }