generate EF model by System.Diagnostics.Process

Posted by loviji on Stack Overflow See other posts from Stack Overflow or by loviji
Published on 2010-03-16T21:40:59Z Indexed on 2010/03/16 22:01 UTC
Read the original article Hit count: 411

Hello, after read this article i tried generate EF model by System.Diagnostics.Process:

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();

1.but i haven't get a result, because i can't do well formed arguments string. As I tried, there have many quotes. how to organize argument string?

2.how can i catch if generation completed or have occurred errors?

© Stack Overflow or respective owner

Related posts about c#

Related posts about entity-framework