Reading edml file

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
delarou
Posts: 15
Joined: Thu 07 Apr 2011 15:12

Reading edml file

Post by delarou » Thu 07 Apr 2011 16:27

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);

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 08 Apr 2011 09:06

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.

Post Reply