< Summary

Information
Class: IceRpc.Ice.Operations.IceOperationAttribute
Assembly: IceRpc.Ice
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Ice/Operations/IceOperationAttribute.cs
Tag: 1321_24790053727
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 35
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
0%
Covered methods: 0
Fully covered methods: 0
Total methods: 4
Method coverage: 0%
Full method coverage: 0%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Name()100%210%
get_ExceptionSpecification()100%210%
get_Idempotent()100%210%
.ctor(...)100%210%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Ice/Operations/IceOperationAttribute.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.ComponentModel;
 4
 5namespace IceRpc.Ice.Operations;
 6
 7/// <summary>An attribute that Ice's Slice compiler (slice2cs) applies to abstract methods it generates on server-side
 8/// interfaces (I{Name}Service). This attribute communicates information about the Ice operation to the IceRPC Service
 9/// Generator (IceRpc.ServiceGenerator): the name of the operation plus various optional properties (see below).
 10/// The Service Generator generates code that matches the operation name in incoming requests to the operation name
 11/// specified by this attribute.</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 number of
 14/// parameters and their mapped types.</remarks>
 15[AttributeUsage(AttributeTargets.Method, Inherited = false)]
 16[EditorBrowsable(EditorBrowsableState.Never)]
 17public sealed class IceOperationAttribute : Attribute
 18{
 19    /// <summary>Gets the operation name.</summary>
 20    /// <value>The operation name.</value>
 021    public string Name { get; }
 22
 23    /// <summary>Gets the exception specification of the operation.</summary>
 24    /// <value>An array of Ice exception types that the operation may throw.</value>
 25    /// <seealso cref="IceException"/>
 026    public Type[] ExceptionSpecification { get; init; } = [];
 27
 28    /// <summary>Gets a value indicating whether the operation is idempotent.</summary>
 29    /// <value><see langword="true"/> if the operation is idempotent; otherwise, <see langword="false"/>.</value>
 030    public bool Idempotent { get; init; }
 31
 32    /// <summary>Constructs an Ice operation attribute.</summary>
 33    /// <param name="name">The operation name.</param>
 034    public IceOperationAttribute(string name) => Name = name;
 35}