user380719
user380719

Reputation: 9903

Is there an API to read an EDMX file

If I have an .edmx file, is there a way to programmatically access it? I could use XDocument but maybe there is already an api for this?

Upvotes: 1

Views: 1687

Answers (2)

TheDev6
TheDev6

Reputation: 872

Library for Object access to edmx

This worked for me fairly well to loop through the entities and generate code tiers from their definitions.. It's really a gold mine for code generation though I wish the built in EF stuff was open source. I can't quite figure out how to create C# objects based on stored procedure results the way EF does.

Upvotes: 0

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364359

EDMX file is only for designer. It is even not distributed with your application as is. EDMX contains four components - SSDL, MSL, CSDL and designer information. First three components are extracted during building application and are stored either as resource XML files in the assembly or shipped as external XML files. These files can be read as any other XML files. The only API (present in .NET) which can load them is EntityConnection / MetadataWorkspace in EF.

Upvotes: 2

Related Questions