2

Is it possible to generate an Edmx file by creating the collections (schema, conceptual, mappings) and mappings in code and building it up in C#? Note - I've used EdmGen and EdmGen2 which read from a database to create the Edmx. I want to be able to pass the specific items into the metadata without pointing at a database.

Any ideas appreciated. thanks.

1

2 Answers 2

2

Why not use code first? This is essentially what code first does; it inspects the POCO CLR types you have in your project and creates the corresponding conceptual/storage/mappings by convention. You can also configure those conventions through a fluent code API.

When you spin up a code first DbContext, you can also get to the resulting XML-based EDMX (if you really need it) from within it through a WriteEdmx() method.

If you don't want Code First to generate a database automatically, you can turn off that 'initializer'.

Sign up to request clarification or add additional context in comments.

Comments

0

You can write a simple dummy db context and use this VS extension to get the EDMX generated http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.