Ejemplo 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, LeaseAPIBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_DeleteLeaseEvent, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.DeleteLeaseEventRequest, global::Tutorial.Lease.V1.DeleteLeaseEventResponse>(serviceImpl.DeleteLeaseEvent));
     serviceBinder.AddMethod(__Method_ListLeases, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.ListLeasesRequest, global::Tutorial.Lease.V1.ListLeasesResponse>(serviceImpl.ListLeases));
     serviceBinder.AddMethod(__Method_ListLeaseEvents, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.ListLeaseEventsRequest, global::Tutorial.Lease.V1.ListLeaseEventsResponse>(serviceImpl.ListLeaseEvents));
     serviceBinder.AddMethod(__Method_GetLease, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.GetLeaseRequest, global::Tutorial.Lease.V1.GetLeaseResponse>(serviceImpl.GetLease));
     serviceBinder.AddMethod(__Method_CreateLease, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.CreateLeaseRequest, global::Tutorial.Lease.V1.CreateLeaseResponse>(serviceImpl.CreateLease));
     serviceBinder.AddMethod(__Method_TerminateLease, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.TerminateLeaseRequest, global::Tutorial.Lease.V1.TerminateLeaseResponse>(serviceImpl.TerminateLease));
     serviceBinder.AddMethod(__Method_SchedulePayment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.SchedulePaymentRequest, global::Tutorial.Lease.V1.SchedulePaymentResponse>(serviceImpl.SchedulePayment));
     serviceBinder.AddMethod(__Method_ReceivePayment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Tutorial.Lease.V1.ReceivePaymentRequest, global::Tutorial.Lease.V1.ReceivePaymentResponse>(serviceImpl.ReceivePayment));
 }
Ejemplo 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(LeaseAPIBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_DeleteLeaseEvent, serviceImpl.DeleteLeaseEvent)
            .AddMethod(__Method_ListLeases, serviceImpl.ListLeases)
            .AddMethod(__Method_ListLeaseEvents, serviceImpl.ListLeaseEvents)
            .AddMethod(__Method_GetLease, serviceImpl.GetLease)
            .AddMethod(__Method_CreateLease, serviceImpl.CreateLease)
            .AddMethod(__Method_TerminateLease, serviceImpl.TerminateLease)
            .AddMethod(__Method_SchedulePayment, serviceImpl.SchedulePayment)
            .AddMethod(__Method_ReceivePayment, serviceImpl.ReceivePayment).Build());
 }