Skip to content

Instantly share code, notes, and snippets.

@tjrobinson
Created January 18, 2012 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjrobinson/1633831 to your computer and use it in GitHub Desktop.
Save tjrobinson/1633831 to your computer and use it in GitHub Desktop.
Generate EDMX file from Entity Framework Code First Context
// See: http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/4aa54da1-3099-48ef-9402-ca94cbca19eb/
builder.DiscoverEntitiesFromContext(typeof(MyContext));
DbModel model = builder.CreateModel();
XmlWriter writer = new XmlTextWriter(Path + "MyContext.edmx", Encoding.UTF8);
model.WriteEdmx(conn, writer);
writer.Close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment