문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top