I have the need to regenerate my Entity Model using code. I don't wan't to go and right click and update model from database every time there is a change.
So i started looking at EdmGen and EdmGen2
I use EdmGen2 to pregenerate my Model Views for me:
using (System.Diagnostics.Process process = new System.Diagnostics.Process())
{
process.StartInfo.FileName = @"C:\EdmGen2.exe";
process.StartInfo.Arguments = @"/ViewGen cs ""C:\Project\EntityFramework\Model\ApplicationEntityModel.edmx""";
process.StartInfo.WorkingDirectory = @"C:\Project\EntityFramework\Model";
process.Start();
process.WaitForExit();
}
This works perfectly.
No i am trying to regenerate my Entity Model:
using (System.Diagnostics.Process process = new System.Diagnostics.Process())
{
process.StartInfo.FileName = @"C:\EdmGen2.exe";
process.StartInfo.Arguments = String.Format(@"/ModelGen ""{0}"" ""System.Data.SqlClient"" ""ApplicationEntityModel""", ConnectionString);
process.StartInfo.WorkingDirectory = @"C:\Project\EntityFramework\Model";
process.Start();
process.WaitForExit();
}
This only generates the .edmx file. Can't specify namespaces so this is not working for me.
Is there any tool or template that i can use to completely regenerate my Entity Model', this includes the.edmxanddesigner.cs`?