开发者

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

开发者 https://www.devze.com 2023-02-17 05:55 出处:网络
I\'m working on a project that is using linq to sql. In my model folder I have 4 files: model.csdl model.edmx

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 =&开发者_如何学JAVAgt; new item => ADO.NET Entity Data Model. But I don't know how to create the other files.

Thanks in advance.

Bruno


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消