Dim values As int[] = Enum.GetValues(typeof(EntityType)) As (int[])
For Each ent As EntityType In values
'Do something, for instance, print entity name
Console.WriteLine(ent.ToString())
Next
Public Shared Sub CreateEntityTypeDalDBlist()
Dim typeArray() As Type
Dim entityTypeList As New List(Of Type)
Dim dalAssemblyReference As System.Reflection.Assembly
'one of the entity
Dim anEntity As New EntityClasses.AddressEntity
'get a reference to the DAL assembly
dalAssemblyReference = anEntity.GetType.Assembly
'get all class/type in the assembly
typeArray = dalAssemblyReference.GetExportedTypes()
'check all class in the asembly
Dim c As Integer
For c = 0 To typeArray.Length - 1
'check if this class/type is an entity
If typeArray(c).Namespace.EndsWith(".EntityClasses") AndAlso (typeArray(c).GetInterface(GetType(IEntity2).FullName, True) IsNot Nothing) Then
'it's an entity, add to the entity type list
entityTypeList.Add(typeArray(c))
End If
Next
End Sub