Exemplo n.º 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, ObjectServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_Get, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::NeoFS.API.v2.Object.GetRequest, global::NeoFS.API.v2.Object.GetResponse>(serviceImpl.Get));
     serviceBinder.AddMethod(__Method_Put, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod <global::NeoFS.API.v2.Object.PutRequest, global::NeoFS.API.v2.Object.PutResponse>(serviceImpl.Put));
     serviceBinder.AddMethod(__Method_Delete, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::NeoFS.API.v2.Object.DeleteRequest, global::NeoFS.API.v2.Object.DeleteResponse>(serviceImpl.Delete));
     serviceBinder.AddMethod(__Method_Head, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::NeoFS.API.v2.Object.HeadRequest, global::NeoFS.API.v2.Object.HeadResponse>(serviceImpl.Head));
     serviceBinder.AddMethod(__Method_Search, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::NeoFS.API.v2.Object.SearchRequest, global::NeoFS.API.v2.Object.SearchResponse>(serviceImpl.Search));
     serviceBinder.AddMethod(__Method_GetRange, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::NeoFS.API.v2.Object.GetRangeRequest, global::NeoFS.API.v2.Object.GetRangeResponse>(serviceImpl.GetRange));
     serviceBinder.AddMethod(__Method_GetRangeHash, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::NeoFS.API.v2.Object.GetRangeHashRequest, global::NeoFS.API.v2.Object.GetRangeHashResponse>(serviceImpl.GetRangeHash));
 }
Exemplo n.º 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 grpc::ServerServiceDefinition BindService(ObjectServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Get, serviceImpl.Get)
            .AddMethod(__Method_Put, serviceImpl.Put)
            .AddMethod(__Method_Delete, serviceImpl.Delete)
            .AddMethod(__Method_Head, serviceImpl.Head)
            .AddMethod(__Method_Search, serviceImpl.Search)
            .AddMethod(__Method_GetRange, serviceImpl.GetRange)
            .AddMethod(__Method_GetRangeHash, serviceImpl.GetRangeHash).Build());
 }