@@ -71,14 +71,27 @@ public readonly struct TypeInfoMapping(Type type, string dataTypeName, TypeInfoF
7171 public Func < Type ? , bool > ? TypeMatchPredicate { get ; init ; }
7272
7373 public bool TypeEquals ( Type type ) => TypeMatchPredicate ? . Invoke ( type ) ?? Type == type ;
74- public bool DataTypeNameEquals ( string dataTypeName )
74+
75+ private bool DataTypeNameEqualsCore ( string dataTypeName )
7576 {
7677 var span = DataTypeName . AsSpan ( ) ;
7778 return Postgres . DataTypeName . IsFullyQualified ( span )
7879 ? span . Equals ( dataTypeName . AsSpan ( ) , StringComparison . Ordinal )
7980 : span . Equals ( Postgres . DataTypeName . ValidatedName ( dataTypeName ) . UnqualifiedNameSpan , StringComparison . Ordinal ) ;
8081 }
8182
83+ internal bool DataTypeNameEquals ( DataTypeName dataTypeName )
84+ {
85+ var value = dataTypeName . Value ;
86+ return DataTypeNameEqualsCore ( value ) ;
87+ }
88+
89+ public bool DataTypeNameEquals ( string dataTypeName )
90+ {
91+ var normalized = Postgres . DataTypeName . NormalizeName ( dataTypeName ) ;
92+ return DataTypeNameEqualsCore ( normalized ) ;
93+ }
94+
8295 string DebuggerDisplay
8396 {
8497 get
@@ -125,7 +138,7 @@ public TypeInfoMappingCollection(IEnumerable<TypeInfoMapping> items)
125138 {
126139 var looseTypeMatch = mapping . TypeMatchPredicate is { } pred ? pred ( type ) : type is null || mapping . Type == type ;
127140 var typeMatch = type is not null && looseTypeMatch ;
128- var dataTypeMatch = dataTypeName is not null && mapping . DataTypeNameEquals ( dataTypeName . Value . Value ) ;
141+ var dataTypeMatch = dataTypeName is not null && mapping . DataTypeNameEquals ( dataTypeName . Value ) ;
129142
130143 var matchRequirement = mapping . MatchRequirement ;
131144 if ( dataTypeMatch && typeMatch
0 commit comments