In a solution I have noticed a property that has a type enum:
Public Enum ContentType
HTML = 1
JSON = 2
XML = 3
End Enum
Public Property ContentID() As ContentType
Get
Return _contentID
End Get
Set(ByVal value As ContentType)
_contentID= value
End Set
End Property
Strangely these enums reflect a primary key in a table, I had an issue as a client had different primary keys and this was causing a select statement to not be entered.
Everything else seems to be working and it just got me thinking. My question is will this property throw an error if I try to set the value to be something that isn't contained in the enum? Because as I say this will definitely be happening and I have seen no errors thrown or am I missing something.