Page 1 of 1

Reading edml file

Posted: Thu 07 Apr 2011 16:27
by delarou
Is it possible to read an EDML file, so that you can browse it in a typed way through the EntityContextModel that reside in the EntityDeveloper.Orm.EntityFramework assembly?

I tried the something like below, but with no luck.

Code: Select all

var entityContextModel = new EntityContextModel();    
Services.RegisterModel(entityContextModel);            
Services.AddService(entityContextModel, new OracleVendor("..."));
                                              
var deserializer = new EntityModelDeserializer();
IModelContainer modelContainer = deserializer as IModelContainer;
modelContainer.Initialize(entityContextModel);            
deserializer.Load(edmxFile);

Posted: Fri 08 Apr 2011 09:06
by AndreyR
No, this functionality is not available.
Take a look at the MetadataWorkspace class.
One more tip: use the following code to obtain the MetadataWorkSpace instance:

Code: Select all

MetadataWorkspace workspace = (context.Connection as EntityConnection).GetMetadataWorkspace();
The context.MetadataWorkspace returns only conceptual objects.