=== Code examples

==== Noncompliant code example

[source,csharp,diff-id=1,diff-type=noncompliant]
----
int GetValue(List<int> data) =>
    data.FirstOrDefault(x => x % 2 == 0);
----

[source,csharp,diff-id=2,diff-type=noncompliant]
----
int GetValue(int[] data) =>
    data.FirstOrDefault(x => x % 2 == 0);
----

==== Compliant solution

[source,csharp,diff-id=1,diff-type=compliant]
----
int GetValue(List<int> data) =>
    data.Find(x => x % 2 == 0);
----

[source,csharp,diff-id=2,diff-type=compliant]
----
int GetValue(int[] data) =>
    Array.Find(data, x => x % 2 == 0);
----
