=== Code examples

==== Noncompliant code example

[source,csharp,diff-id=1,diff-type=noncompliant]
----
private class MyClass  // Noncompliant
{
  // ...
}

private record MyRecord  // Noncompliant
{
  // ...
}
----

[source,csharp,diff-id=2,diff-type=noncompliant]
----
file class MyClass  // Noncompliant
{
  // ...
}

file record MyRecord  // Noncompliant
{
  // ...
}
----

==== Compliant solution

[source,csharp,diff-id=1,diff-type=compliant]
----
private sealed class MyClass
{
  // ...
}

private sealed record MyRecord
{
  // ...
}
----

[source,csharp,diff-id=2,diff-type=compliant]
----
file sealed class MyClass
{
  // ...
}

file sealed record MyRecord
{
  // ...
}
----