Reverse engineering a subset of tables for Entity Framework

后端 未结 4 1748
耶瑟儿~
耶瑟儿~ 2020-12-31 06:19

I\'m using EF, and I\'ve got the Entity Framework Power Tools extension, which lets me reverse engineer classes based on tables in a given database.

We have a rathe

4条回答
  •  梦谈多话
    2020-12-31 07:19

    As of now, there is no way to exclude tables out-of-the-box with EF Power Tools. They say this feature request is already in the backlog but is unclear if it's going to make it into the RTM.

    I've seen two main approaches to work around this:

    1. Tweak the Reverse Engineering templates to ignore all unwanted tables (although I personally find this messy). If you want to get started on what are the moving parts, here's an article from Rowan Miller (http://romiller.com/2012/05/09/customizing-reverse-engineer-code-first-in-the-ef-power-tools/)

    2. Create a dummy DB with only the tables you're interested in and let the reverse engineering do its magic. An alternative to this is to have a "special db user" that only has access to the relevant tables and use it when connecting.

提交回复
热议问题