<PackageReference Include="Google.Protobuf" Version="3.34.2" />

Google.Protobuf.Reflection.ServiceDescriptor

public sealed class ServiceDescriptor : DescriptorBase
Describes a service type.
public CustomOptions CustomOptions { get; }

The (possibly empty) set of custom options for this service.

public IList<MethodDescriptor> Methods { get; }

public MethodDescriptor FindMethodByName(string name)

Finds a method by name.

public T GetOption<T>(Extension<ServiceOptions, T> extension)

Gets a single value service option for this descriptor

Gets a repeated value service option for this descriptor

The ServiceOptions, defined in descriptor.proto. If the options message is not present (i.e. there are no options), null is returned. Custom options can be retrieved as extensions of the returned message. NOTE: A defensive copy is created each time this property is retrieved.

Returns a clone of the underlying ServiceDescriptorProto describing this service. Note that a copy is taken every time this method is called, so clients using it frequently (and not modifying it) may want to cache the returned value.