Skip to content

Commit b05b83f

Browse files
Fixed no more camel case on any property within a magic table attributed class.
1 parent 6c6126e commit b05b83f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Magic.IndexedDb/Helpers/PropertyMappingCache.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)