Search code examples
c#entity-framework-4edmxssdlcsdl

EF4: How to generate: .csdl, .edmx, .msl and .ssdl files


I'm working on a project that is using linq to sql. In my model folder I have 4 files:

model.csdl
model.edmx
model.msl
model.ssdl

But that model is out of date with the current database.

I'm wondering how I can update the model, via an automate process (if possible).

And also I'm wondering how I can generate those files. I can create an .edmx file via add => new item => ADO.NET Entity Data Model. But I don't know how to create the other files.

Thanks in advance.

Bruno


Solution

  • Double click the .edmx file to open the designer. In the middle of the designer, right click to show the contextual menu and click "update model from database". It will prompt a screen, check the DB parameters and click next. Now, you're in a sreen with TABS. The second tab will its for update the model. Select the tables and views you need to update and click next. That's all.