John Mott
John Mott

Reputation: 445

how do you access metadata from a T4 template with code-first entity framework?

I'm using Entity Framework with database-first because that was an easier learning curve. I've read that EF 7 will no longer use the EDMX file and that code-first will be the way to go.

I'm thinking of going ahead and converting to code-first now because my project is still relatively young, but am not sure how to get access to the metadata that EDMX provides. I use T4 templates extensively and need to get access to the metadata.

Is anyone using T4 templates with code-first, and if so how are you getting the metadata?

thanks,

john

Upvotes: 0

Views: 406

Answers (2)

John Mott
John Mott

Reputation: 445

The answer to the question is that metadata is available from the context object, as discussed in this post

How I can read EF DbContext metadata programmatically?

Upvotes: 0

ErikEJ
ErikEJ

Reputation: 41779

Use the EF Reverse POCO template available in the VS Gallery

Upvotes: 1

Related Questions