
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.
43 lines
855 B
Plaintext
43 lines
855 B
Plaintext
include::../why-dotnet.adoc[]
|
|
|
|
include::../impact-dotnet.adoc[]
|
|
|
|
include::../how-dotnet.adoc[]
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,vbnet,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
Function GetFirst(data As LinkedList(Of Integer)) As Integer
|
|
Return Enumerable.First(data)
|
|
End Function
|
|
----
|
|
|
|
[source,vbnet,diff-id=2,diff-type=noncompliant]
|
|
----
|
|
Function GetLast(data As LinkedList(Of Integer)) As Integer
|
|
Return Enumerable.Last(data)
|
|
End Function
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,vbnet,diff-id=1,diff-type=compliant]
|
|
----
|
|
Function GetFirst(data As LinkedList(Of Integer)) As Integer
|
|
Return data.First.Value
|
|
End Function
|
|
----
|
|
|
|
[source,vbnet,diff-id=2,diff-type=compliant]
|
|
----
|
|
Function GetLast(data As LinkedList(Of Integer)) As Integer
|
|
Return data.Last.Value
|
|
End Function
|
|
----
|
|
|
|
|
|
include::../resources-dotnet.adoc[]
|