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[]
