Title: ef core db context scaffold exclude keyless entities
Tags: entity-framework;ef-database-first;ef-core-3.0
Question: Is there any way I can exclude keyless entities from scaffolding? I have a ton of tables without a primary key. I need ef to scaffold only the tables with a primary key. If this is not supported, any way to hook this in the IDesignTimeService (like we do for pluralize/singularize entities and dbsets)/something similar. Basically I am trying to write a script that does some operations based on scaffolding. So zero manual intervention is the goal. Any help would be appreciated. Thanks in advance!
Comment: Use EF Core Power Tools to help you choose only the tables with primary keys

Comment: The standard tools have a table filter

Comment: Also Power Tools have an undocumented command line interface

Comment: It requires the extension to be installed currently

Comment: But it is just a zip file

Comment: No, it does not, as it is not implemented in EF Core scaffolding yet.

Comment: @ErikEJ Yeah. thanks for the fantastic tool. I use your EF Core Power Tools only in general. However here I am trying to do an automation.  Do you know if this is possible to have CLI to generate only entities with the pk using ef 3.1?

Comment: @ErikEJ thanks. There are numerous tables in our VERY old db, and "including" with filter is not an option. Does the power tools cli can be installed with "dotnet tool "? or does this require the extension to be installed?

Comment: great. Is the Power Tool currently handle new C#'s nullable reference type as well?



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 9, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:12/13/19', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<entity-framework><ef-database-first><ef-core-3.0>', 'Title': 'ef core db context scaffold exclude keyless entities', 'ViewCount': 588, 'id': 59327435, 'user_AboutMe': None, 'user_AccountId': 4864292.0, 'user_DisplayName': 'My Helper', 'user_Reputation': 688.0, 'user_Views': 83.0, 'user_id': 3923058.0}}