Loading

Linq = > MyMetal = > SqlMetal Include 自定义(Linq to sql )生成

CodePlex:SqlMetal Include
把这个好东西推荐给大家。点击进去后如果发现没有发布版千万别惊讶,作者说他忙,让我们下载源代码就好了,尽管不太方便,但是在源代码中已经有发布版本了。相对一些由发布版但是粗制滥造不同,作者现在这个版本已经非常棒了。以下是引用的codeplex的图:
NOTE: Please download the source code, it has compiled executables in it, I am short on time at the moment, and the source contains all the latest bug fixed

Project Description
SqlMetalInclude lets you simply and quickly modify the DBML file to remove unwanted tables/views from it, as well as being able to rename the entities giving more meaning in the generated code.
There is also a GUI which lets you configure everything, including the SqlMetal config

Screenshots of GUI

Startup screen, config is automatically saved at each step of the wizard.
Exclude mode (also explained in tooltip) controls how new tables/views are handled, in exclude mode, new tables will not be included.
Startup.png

Setup the SqlMetal DBML generation
SqlMetal Config.png

We can now select the tables/views that we want to be included in the final DBML and also rename the collections or entity names
SelectDbo.png

When you hit continue it will run sqlmetalinclude to modify the full dbml file, you can continue once it has been run and no further changes have been made.
SelectDboRun.png

You can now either export a .cmd file and SqlMetalInclude.exe which will regenerate your code file from scratch, so it will infact refresh your DataContext and associated classes to match the database structure.
SaveCode.png

posted @ 2009-08-01 15:11  today4king  阅读(697)  评论(0编辑  收藏  举报