
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.
39 lines
671 B
Plaintext
39 lines
671 B
Plaintext
include::../why-dotnet.adoc[]
|
|
|
|
include::../impact-dotnet.adoc[]
|
|
|
|
include::../how-dotnet.adoc[]
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,csharp,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
int GetFirst(LinkedList<int> data) =>
|
|
data.First();
|
|
----
|
|
|
|
[source,csharp,diff-id=2,diff-type=noncompliant]
|
|
----
|
|
int GetLast(LinkedList<int> data) =>
|
|
data.Last();
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,csharp,diff-id=1,diff-type=compliant]
|
|
----
|
|
int GetFirst(LinkedList<int> data) =>
|
|
data.First.Value;
|
|
----
|
|
|
|
[source,csharp,diff-id=2,diff-type=compliant]
|
|
----
|
|
int GetLast(LinkedList<int> data) =>
|
|
data.Last.Value;
|
|
----
|
|
|
|
|
|
include::../resources-dotnet.adoc[]
|