我需要重新生成我的Entity Model
使用代码。我不想去,right click and update model from database
每次都有变化。
我用来为我EdmGen2
预生成我Model Views
的:
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();
}
这完美地工作。
不,我正在尝试重新生成我的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();
}
这只会生成.edmx
文件。无法指定命名空间,所以这对我不起作用。
是否有任何tool
或template
我可以用来完全重新生成我的Entity Model', this includes the
.edmx and
Designer.cs`?