Skip to content

Commit c9c0f5f

Browse files
Quick cleanup to centralize methods
1 parent f7df775 commit c9c0f5f

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Magic.IndexedDb/Models/Structs/MagicPropertyEntry.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public MagicPropertyEntry(PropertyInfo property, IColumnNamed? columnNamedAttrib
2727
PrimaryKey = primaryKey;
2828
NotMapped = notMapped;
2929

30-
IsComplexType = IsComplexTypeFunc(property.PropertyType);
30+
IsComplexType = PropertyMappingCache.IsComplexType(property.PropertyType);
3131

3232
// 🔥 Identify if this property is a constructor parameter
3333
var declaringType = property.DeclaringType!;
@@ -56,15 +56,6 @@ public MagicPropertyEntry(PropertyInfo property, IColumnNamed? columnNamedAttrib
5656
}
5757
}
5858

59-
private bool IsComplexTypeFunc(Type type)
60-
{
61-
return !(PropertyMappingCache.IsSimpleType(type)
62-
|| type == typeof(string)
63-
|| typeof(IEnumerable).IsAssignableFrom(type) // Non-generic IEnumerable
64-
|| (type.IsGenericType && typeof(IEnumerable<>).IsAssignableFrom(type.GetGenericTypeDefinition())) // Generic IEnumerable<T>
65-
|| type.IsArray); // Arrays are collections too
66-
}
67-
6859
public object? DefaultValue { get; }
6960

7061
/// <summary>

0 commit comments

Comments
 (0)