Skip to content

Commit 1c6b9ba

Browse files
authored
Merge pull request #3385 from codajo/patch-2
Update SA1600 to show inheritance example.
2 parents 6cd35b5 + b54862d commit 1c6b9ba

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

documentation/SA1600.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,36 @@ public string JoinNames(string firstName, string lastName)
4444
}
4545
```
4646

47+
The next example shows a method that inherits documentation from a method in the base class:
48+
49+
```csharp
50+
/// <summary>
51+
/// Example base class.
52+
/// </summary>
53+
class Vehicle
54+
{
55+
/// <summary>
56+
/// Accelerates the vehicle.
57+
/// </summary>
58+
public virtual void Accelerate()
59+
{
60+
Console.WriteLine("Vehicle is accelerating");
61+
}
62+
}
63+
64+
/// <summary>
65+
/// Example derived class.
66+
/// </summary>
67+
class Car : Vehicle
68+
{
69+
/// <inheritdoc/>
70+
public override void Accelerate()
71+
{
72+
Console.Writeline("Car is accelerating");
73+
}
74+
}
75+
```
76+
4777
## How to suppress violations
4878

4979
```csharp

0 commit comments

Comments
 (0)