阅读本文后,我尝试通过 System.Diagnostics.Process 生成 EF 模型:
Process myProcess = new Process();
var cs = "Data Source=.\\SQLEXPRESS; Initial Catalog=uqs; Integrated Security=SSPI";
myProcess.StartInfo.FileName = @"C:\Windows\Microsoft.NET\Framework\v3.5\EdmGen.exe";
myProcess.StartInfo.Arguments = "/mode:fullgeneration /c:"+cs+" project:School /entitycontainer:SchoolEntities /namespace:SchoolModel /language:CSharp ";
myProcess.Start();
但我没有得到结果,因为我不能做格式良好的参数字符串。正如我所尝试的,有很多引号。如何组织参数字符串?