Adds the AsDgml() extension method to any derived DbContext.
The method will create a DGML graph of your DbContext Model, that you can then view in the Visual Studio DGML viewer.
You can add code like this to in a Unit Test or similar to create the diagram:
using (var myContext = new MyDbContext())
{
var path = Path.GetTempFileName() + ".dgml";
File.WriteAllText(path, myContext.AsDgml(), Encoding.UTF8);
var startInfo = new ProcessStartInfo(path)
{
UseShellExecute = true,
};
Process.Start(startInfo);
}
Please report any issues, questions and suggestions here