How can I get a list of all Entities Type generated from a Entity data model (*.edmx)?
I already have the names of the tables from the database and an instance of the model (.edmx).
I want to have an instance of Type of all the data entities.
let’s suppose my database have two tables:
Employee
EmployeeType
then the model will generate 2 classes and map the data. What I’m searching is a way to obtain a List(of Type).
In this case, the result list would countain an instance of Employee.GetType() and EmployeeType.getType()
Thanks!
(VS2010, VB.NET, EF4)
One of the ways to do it is:
I have not tried it before but you may be even able to get the items directly from the workspace:
If you are using DbContext you can get ObjectContext as follows: