Retrieve metadata from a database with EntityFramework

77 views Asked by At

I'd like to retrieve the metadata from a given database with EntityFramework. I've tried to use this code :

var objectContext = ((IObjectContextAdapter)context).ObjectContext;
var meta = objectContext.GetMetadataWorkspace().GetEntityContainer(objectContext.DefaultContainerName, DataSpace.CSpace);
var sets = meta.BaseEntitySets;

But sets is empty because the POCOs have to be created first.

I'd like to retrieve the metadata in order to create the POCOs without using the designer tool.

0

There are 0 answers