Is there a way to get at the EntityType Enum value of an EntityBase Object?
I am asking because a select case for an enumerated type goes directly to that case without going through every case as it does with strings and in an if elseif statement.
The EntityBase object has data and I would like to use something like:
dim MyEntityBase as EntityBase=SelectedNode()
Select Case MyEntityBase.EntityType
Case CustomerEntity
Display(directcast(MyEntityBase,CustomerEntity))
Case EmployeeEntity
Display(directcast(MyEntityBase,EmployeeEntity))
Case OrderEntity
Display(directcast(MyEntityBase,OrderEntity))
Case Else
Display(MyEntityBase)
End Select
Rather than using:
If (typeOf MyEntityBase is CustumerEntity) then
Display(directcast(MyEntityBase,CustomerEntity)
elseif (typeOf MyEntityBase is EmployeeEntity) then
Display(directcast(MyEntityBase,EmployeeEntity)
elseif (typeOf MyEntityBase is OrderEntity) then
Display(directcast(MyEntityBase,OrderEntity)
else
Display(MyEntityBase)
end if