I am trying to process metadata information for an Entity Framework data model using MetadataWorkspace. I know how to retrieve all tables, but the following code will return me all views and all tables from the storage model.
using ( NorthwindEntities dbContext = new NorthwindEntities() )
{
MetadataWorkspace workspace = dbContext.MetadataWorkspace;
string temp = ( dbContext.Categories as ObjectQuery ).ToTraceString();
IEnumerable<EntityType> tables = workspace.GetItems<EntityType>( DataSpace.SSpace );
}
When I look at the edmx file, I see that there is an attribute called store: Type that describes which EntitySet is a table and represents a view. This property is not associated with an EntityType object:
<EntitySet Name="Invoices" EntityType="NorthwindModel.Store.Invoices" store:Type="Views">
So my question is: is there a way to recognize which EntitySet is a table and which is a view using only metadata? (I mean without XML processing;))
Thanks in advance
source
share