We recommend using Visual Studio 2017

Property names should not match get methods







Breaking Change


The name of a public or protected member starts with 'Get' and otherwise matches the name of a public or protected property. For example, a type that contains a method named 'GetColor' and a property named 'Color' violates this rule.

Get methods and properties should have names that clearly distinguish their function.

Naming conventions provide a common look for libraries that target the common language runtime. This reduces the time it takes to learn a new software library, and increases customer confidence that the library was developed by someone with expertise in developing managed code.

Change the name so that it does not match the name of a method prefixed with 'Get'.

Do not exclude a warning from this rule.

The following example contains a method and property that violate this rule.

Imports System

Namespace NamingLibrary

Public Class Test
    Public ReadOnly Property [Date]() As DateTime
            Return DateTime.Today
        End Get
    End Property

     ' Violates rule: PropertyNamesShouldNotMatchGetMethods.
    Public Function GetDate() As String
        Return Me.Date.ToString()
    End Function 

End Class 

End Namespace