Class ServiceAspectAttribute
Declares the scope and the operations that a gRPC service method is protected with.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class ServiceAspectAttribute : Attribute
- Inheritance
-
ServiceAspectAttribute
- Inherited Members
Remarks
Only applicable to methods. The attribute carries data only: it is up to the caller reading it (for example a server interceptor) to enforce it.
Constructors
ServiceAspectAttribute(params int[])
Creates the attribute with an empty scope.
public ServiceAspectAttribute(params int[] operations)
Parameters
operationsint[]The identifiers of the operations required to call the method.
ServiceAspectAttribute(string, params int[])
Creates the attribute with a scope and operations.
public ServiceAspectAttribute(string scope, params int[] operations)
Parameters
scopestringThe scope; trimmed, and an empty string when null or white space.
operationsint[]The identifiers of the operations required to call the method.
Properties
Operations
Gets or sets the identifiers of the operations required to call the method.
public int[] Operations { get; set; }
Property Value
- int[]
Scope
Gets or sets the scope; an empty string when none was given.
public string Scope { get; set; }
Property Value
Methods
Empty()
Creates an attribute with an empty scope and no operation.
public static ServiceAspectAttribute Empty()
Returns
- ServiceAspectAttribute
The empty attribute.