include::../why-dotnet.adoc[]

include::../how-dotnet.adoc[]

=== Code examples

==== Noncompliant code example

[source,vbnet,diff-id=1,diff-type=noncompliant]
----
Function ContainsEven(data As List(Of Integer)) As Boolean
    Return data.Any(Function(x) x Mod 2 = 0)
End Function
----

[source,vbnet,diff-id=2,diff-type=noncompliant]
----
Function ContainsEven(data() As Integer) As Boolean
    Return data.Any(Function(x) x Mod 2 = 0)
End Function
----

==== Compliant solution

[source,vbnet,diff-id=1,diff-type=compliant]
----
Function ContainsEven(data As List(Of Integer)) As Boolean
    Return data.Exists(Function(x) x Mod 2 = 0)
End Function
----

[source,vbnet,diff-id=2,diff-type=compliant]
----
Function ContainsEven(data() As Integer) As Boolean
    Return Array.Exists(data, Function(x) x Mod 2 = 0)
End Function
----


include::../resources-dotnet.adoc[]
