=== Code examples

==== Noncompliant code example

[source,csharp,diff-id=1,diff-type=noncompliant]
----
int GetAt(List<int> data, int index) 
    => data.ElementAt(index);
----

[source,csharp,diff-id=2,diff-type=noncompliant]
----
int GetFirst(List<int> data) 
    => data.First();
----

[source,csharp,diff-id=3,diff-type=noncompliant]
----
int GetLast(List<int> data) 
    => data.Last();
----

==== Compliant solution

[source,csharp,diff-id=1,diff-type=compliant]
----
int GetAt(List<int> data, int index) 
    => data[index];
----

[source,csharp,diff-id=2,diff-type=compliant]
----
int GetFirst(List<int> data) 
    => data[0];
----

[source,csharp,diff-id=3,diff-type=compliant]
----
int GetLast(List<int> data) 
    => data[data.Count-1]; 
----
