Problem refreshing tables in the LINQ to SQL designer

后端 未结 9 1394
野趣味
野趣味 2021-02-08 12:54

I have been using LINQ to SQL for a while, and there is one thing that has always bothered me. Whenever I modify the schema of a table, in order to refresh it in the designer, I

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-08 13:33

    I have written an add-in that can do that (in both directions; database -> DBML or DBML- -> SQL-DDL diff script).

    Unlike SQLMetal (or EF's "update model from database") mentioned in another reply, the add-in does a true sync/refresh; applying changes corresponding only to the differences between the model and the underlying db.

    That means any customizations (renamed properties/navigation properties etc) that you have made in other areas of your model will not be removed/overwritten unless they are in conflict with the underlying db schema. (in which case you can still preserve them by adding them to the add-in's "exclusion list")

    You can download it and get a free 30-day trial license from http://www.huagati.com/dbmltools/

提交回复
热议问题