== Why is this an issue?

include::../description.adoc[]

=== Exceptions

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

== How to fix it

include::../howtofix.adoc[]

=== Code examples

==== Noncompliant code example

[source,vbnet,diff-id=1,diff-type=noncompliant]
----
Public Class Foo

    Private Name As String = "foobar" ' Noncompliant

    Public ReadOnly Property DefaultName As String = "foobar" ' Noncompliant

    Public Sub New(Optional Value As String = "foobar") ' Noncompliant

        Dim Something = If(Value, "foobar") ' Noncompliant

    End Sub

End Class
----

==== Compliant solution

[source,vbnet,diff-id=1,diff-type=compliant]
----
Public Class Foo

    Private Const Foobar As String = "foobar"

    Private Name As String = Foobar

    Public ReadOnly Property DefaultName As String = Foobar

    Public Sub New(Optional Value As String = Foobar)

        Dim Something = If(Value, Foobar)

    End Sub

End Class
----

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