Skip to content

Commit

Permalink
Merge pull request #3385 from codajo/patch-2
Browse files Browse the repository at this point in the history
Update SA1600 to show inheritance example.
  • Loading branch information
sharwell authored Feb 8, 2022
2 parents 6cd35b5 + b54862d commit 1c6b9ba
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions documentation/SA1600.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,36 @@ public string JoinNames(string firstName, string lastName)
}
```

The next example shows a method that inherits documentation from a method in the base class:

```csharp
/// <summary>
/// Example base class.
/// </summary>
class Vehicle
{
/// <summary>
/// Accelerates the vehicle.
/// </summary>
public virtual void Accelerate()
{
Console.WriteLine("Vehicle is accelerating");
}
}

/// <summary>
/// Example derived class.
/// </summary>
class Car : Vehicle
{
/// <inheritdoc/>
public override void Accelerate()
{
Console.Writeline("Car is accelerating");
}
}
```

## How to suppress violations

```csharp
Expand Down

0 comments on commit 1c6b9ba

Please sign in to comment.