The problem here was i needed a dynamic way to iterate over the EntityObjects which are also consider types in the EDMX. I needed to list the Entity name and its properties. Thanks very much to Craig Stuntz for leading me down the right path to solve this issue. Here is the final code i came up with to solve my problem.
EmployeesEntities context = new EmployeesEntities();
MetadataWorkspace workspace = context.MetadataWorkspace;
workspace.LoadFromAssembly(Assembly.Load(@"WindowsFormsApplication10"));
ItemCollection itemCol = workspace.GetItemCollection(DataSpace.OSpace);
StringBuilder sb = new StringBuilder();
foreach (EdmType eType in itemCol)
{
if (eType.GetType().BaseType == typeof(System.Data.Metadata.Edm.EntityType))
{
sb.Append(string.Format("Entity: {0} ", eType.Name));
foreach (EdmProperty prop in
((System.Data.Metadata.Edm.EntityType)(eType)).Properties)
{
sb.Append(string.Format("Property: {0} ", prop.Name));
}
}
}
MessageBox.Show(sb.ToString());