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

3.8k Views Asked by At

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

2

There are 2 best solutions below

2
On BEST ANSWER

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.

1
On

This is not Linq2SQL, this is Entity Framework.

with Linq2SLQ you can create the mapping with SqlMetal or with the Linq2Sql Desinger. EF has other tools and other Designers.