Question

I can use the Package Manager Console to write some Powershell and automate Visual Studio. I can start the process of adding a Entity Framework Data Model with this code:

$dte.ItemOperations.AddNewItem("Visual C#\Data\ADO.NET Entity Data Model", "Foo.edmx")

I want to to automate the EDM wizard that pops up next so my Powershell script can handle all the steps of adding an EF model to my project. How to I reference this Entity Data Model Wizard in code?

When I manually do this with the macro recorder in Visual Studio running, it will skip these wizard steps for the Entity Data Model Wizard. I was hoping that could show me how to reference it in code.

I want a set of Powershell commands to automate all the wizard steps for adding an EF model to my project. As I understand it, a nuget package can setup all the necessary parts with Powershell and my package will need to configure an Entity Framework model on its own.

Was it helpful?

Solution

Instead of automating the EDM wizard in Powershell, I can use the EdmGen.exe command line utility to perform the task in Powershell.

EdmGen.exe is documented here: http://msdn.microsoft.com/en-us/library/bb738546.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top