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, MruVEconomyServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_RegisterProduct, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Mruv.Economy.RegisterProductRequest, global::Mruv.Economy.RegisterProductResponse>(serviceImpl.RegisterProduct));
     serviceBinder.AddMethod(__Method_GetProduct, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Mruv.Economy.GetProductRequest, global::Mruv.Economy.GetProductResponse>(serviceImpl.GetProduct));
     serviceBinder.AddMethod(__Method_UpdateProduct, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Mruv.Economy.UpdateProductRequest, global::Mruv.Economy.UpdateProductResponse>(serviceImpl.UpdateProduct));
     serviceBinder.AddMethod(__Method_DeleteProduct, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Mruv.Economy.DeleteProductRequest, global::Mruv.Economy.DeleteProductResponse>(serviceImpl.DeleteProduct));
     serviceBinder.AddMethod(__Method_UpdatePrice, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Mruv.Economy.UpdatePriceRequest, global::Mruv.Economy.UpdatePriceResponse>(serviceImpl.UpdatePrice));
     serviceBinder.AddMethod(__Method_GetPrice, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Mruv.Economy.GetPriceRequest, global::Mruv.Economy.GetPriceResponse>(serviceImpl.GetPrice));
     serviceBinder.AddMethod(__Method_BuyProduct, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Mruv.Economy.BuyProductRequest, global::Mruv.Economy.BuyProductResponse>(serviceImpl.BuyProduct));
     serviceBinder.AddMethod(__Method_WatchProduct, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::Mruv.Economy.WatchProductRequest, global::Mruv.Economy.WatchProductResponse>(serviceImpl.WatchProduct));
     serviceBinder.AddMethod(__Method_WatchPrice, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::Mruv.Economy.WatchPriceRequest, global::Mruv.Economy.WatchPriceResponse>(serviceImpl.WatchPrice));
 }
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(MruVEconomyServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_RegisterProduct, serviceImpl.RegisterProduct)
            .AddMethod(__Method_GetProduct, serviceImpl.GetProduct)
            .AddMethod(__Method_UpdateProduct, serviceImpl.UpdateProduct)
            .AddMethod(__Method_DeleteProduct, serviceImpl.DeleteProduct)
            .AddMethod(__Method_UpdatePrice, serviceImpl.UpdatePrice)
            .AddMethod(__Method_GetPrice, serviceImpl.GetPrice)
            .AddMethod(__Method_BuyProduct, serviceImpl.BuyProduct)
            .AddMethod(__Method_WatchProduct, serviceImpl.WatchProduct)
            .AddMethod(__Method_WatchPrice, serviceImpl.WatchPrice).Build());
 }