@@ -67,7 +67,7 @@ public EntityContext Generate(GeneratorOptions options, DatabaseModel databaseMo
6767
6868 foreach ( var table in tables )
6969 {
70- if ( IsIgnored ( table , _options . Database . Exclude ) )
70+ if ( IsIgnored ( table , _options . Database . Exclude . Tables ) )
7171 {
7272 _logger . LogDebug ( " Skipping Table : {schema}.{name}" , table . Schema , table . Name ) ;
7373 continue ;
@@ -175,6 +175,11 @@ private void CreateProperties(Entity entity, DatabaseTable tableSchema)
175175 foreach ( var column in columns )
176176 {
177177 var table = column . Table ;
178+ if ( IsIgnored ( column , _options . Database . Exclude . Columns ) )
179+ {
180+ _logger . LogDebug ( " Skipping Column : {Schema}.{Table}.{Column}" , table . Schema , table . Name , column . Name ) ;
181+ continue ;
182+ }
178183
179184 var mapping = column . StoreType . HasValue ( ) ? _typeMapper . FindMapping ( column . StoreType ) : null ;
180185 if ( mapping == null )
@@ -309,7 +314,7 @@ private void CreateRelationships(EntityContext entityContext, Entity entity, Dat
309314 foreach ( var foreignKey in tableSchema . ForeignKeys )
310315 {
311316 // skip relationship if principal table is ignored
312- if ( IsIgnored ( foreignKey . PrincipalTable , _options . Database . Exclude ) )
317+ if ( IsIgnored ( foreignKey . PrincipalTable , _options . Database . Exclude . Tables ) )
313318 {
314319 _logger . LogDebug ( " Skipping Relationship : {name}" , foreignKey . Name ) ;
315320 continue ;
@@ -728,6 +733,16 @@ private static bool IsIgnored(DatabaseTable table, IEnumerable<MatchOptions> exc
728733 return IsIgnored ( name , excludeExpressions , includeExpressions ) ;
729734 }
730735
736+ private static bool IsIgnored ( DatabaseColumn column , IEnumerable < MatchOptions > exclude )
737+ {
738+ var table = column . Table ;
739+ var name = $ "{ table . Schema } .{ table . Name } .{ column . Name } ";
740+ var includeExpressions = Enumerable . Empty < MatchOptions > ( ) ;
741+ var excludeExpressions = exclude ?? [ ] ;
742+
743+ return IsIgnored ( name , excludeExpressions , includeExpressions ) ;
744+ }
745+
731746 private static bool IsIgnored < TOption > ( Property property , TOption options , SharedModelOptions sharedOptions )
732747 where TOption : ModelOptionsBase
733748 {
0 commit comments