
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
19 lines
499 B
Plaintext
19 lines
499 B
Plaintext
== Why is this an issue?
|
|
|
|
Creating an extension method that extends ``++object++`` is not recommended because it makes the method available on _every_ type. Extensions should be applied at the most specialized level possible, and that is very unlikely to be ``++object++``.
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,csharp]
|
|
----
|
|
public static class MyExtensions
|
|
{
|
|
public static void SomeExtension(this object obj) // Noncompliant
|
|
{
|
|
// ...
|
|
}
|
|
}
|
|
----
|
|
|
|
include::../rspecator.adoc[]
|