File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,8 @@ internal static void EnsureTypeIsCached(Type type)
397397 // Initialize the dictionary for this type
398398 var propertyEntries = new Dictionary < string , MagicPropertyEntry > ( StringComparer . OrdinalIgnoreCase ) ;
399399
400+ bool hasMagicTableAttribute = type . IsDefined ( typeof ( MagicTableAttribute ) , inherit : true ) ;
401+
400402 List < MagicPropertyEntry > newMagicPropertyEntry = new List < MagicPropertyEntry > ( ) ;
401403 foreach ( var property in type . GetProperties ( BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance | BindingFlags . FlattenHierarchy ) )
402404 {
@@ -420,7 +422,7 @@ internal static void EnsureTypeIsCached(Type type)
420422 property . IsDefined ( typeof ( MagicUniqueIndexAttribute ) , inherit : true ) ,
421423 property . IsDefined ( typeof ( MagicPrimaryKeyAttribute ) , inherit : true ) ,
422424 property . IsDefined ( typeof ( MagicNotMappedAttribute ) , inherit : true ) ,
423- property . IsDefined ( typeof ( MagicNameAttribute ) , inherit : true )
425+ hasMagicTableAttribute || property . IsDefined ( typeof ( MagicNameAttribute ) , inherit : true )
424426 ) ;
425427 newMagicPropertyEntry . Add ( magicEntry ) ;
426428 propertyEntries [ propertyKey ] = magicEntry ; // Store property entry with string key
You can’t perform that action at this time.
0 commit comments