| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | using System.ComponentModel; |
| | | 4 | | |
| | | 5 | | namespace IceRpc.Protobuf.RpcMethods; |
| | | 6 | | |
| | | 7 | | /// <summary>An attribute that IceRpc.Protobuf.Generator applies to abstract methods it generates on server-side |
| | | 8 | | /// interfaces (I{Name}Service). This attribute communicates information about the Protobuf rpc method to the Service |
| | | 9 | | /// Generator (IceRpc.ServiceGenerator): currently only the name of the rpc method. The Service Generator generates code |
| | | 10 | | /// that matches the operation name in incoming requests to the method name specified by this attribute. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <remarks>We limit the information communicated through this attribute to the strict minimum. The Service Generator |
| | | 13 | | /// can deduce most information from the signature of the method decorated with this attribute, such as the method |
| | | 14 | | /// kind (unary, client streaming, server streaming, or bidi streaming).</remarks> |
| | | 15 | | [AttributeUsage(AttributeTargets.Method, Inherited = false)] |
| | | 16 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | | 17 | | public sealed class RpcMethodAttribute : Attribute |
| | | 18 | | { |
| | | 19 | | /// <summary>Gets the method name. It corresponds to the name of the rpc method in the Protobuf file, with the |
| | | 20 | | /// same spelling and the same case.</summary> |
| | | 21 | | /// <value>The method name.</value> |
| | 0 | 22 | | public string Name { get; } |
| | | 23 | | |
| | | 24 | | /// <summary>Constructs an RPC method attribute.</summary> |
| | | 25 | | /// <param name="name">The method name.</param> |
| | 0 | 26 | | public RpcMethodAttribute(string name) => Name = name; |
| | | 27 | | } |