@@ -50,7 +50,7 @@ internal void RegisterForPersistence(PersistentComponentState state)
5050 for ( var i = 0 ; i < _registrations . Length ; i ++ )
5151 {
5252 var registration = _registrations [ i ] ;
53- var type = ResolveType ( registration . Assembly , registration . FullTypeName ) ;
53+ var type = ResolveType ( registration ) ;
5454 if ( type == null )
5555 {
5656 continue ;
@@ -112,7 +112,7 @@ private void RestoreRegistrationsIfAvailable(PersistentComponentState state)
112112 {
113113 foreach ( var registration in _registrations )
114114 {
115- var type = ResolveType ( registration . Assembly , registration . FullTypeName ) ;
115+ var type = ResolveType ( registration ) ;
116116 if ( type == null )
117117 {
118118 continue ;
@@ -142,8 +142,16 @@ private static void RestoreInstanceState(object instance, Type type, PersistentC
142142
143143 private static IPersistentServiceRegistration [ ] ResolveRegistrations ( IEnumerable < IPersistentServiceRegistration > registrations ) => [ .. registrations . DistinctBy ( r => ( r . Assembly , r . FullTypeName ) ) . OrderBy ( r => r . Assembly ) . ThenBy ( r => r . FullTypeName ) ] ;
144144
145- private static Type ? ResolveType ( string assembly , string fullTypeName ) =>
146- _persistentServiceTypeCache . GetRootType ( assembly , fullTypeName ) ;
145+ private static Type ? ResolveType ( IPersistentServiceRegistration registration )
146+ {
147+ if ( registration . GetResolvedTypeOrNull ( ) is Type type )
148+ {
149+ return type ;
150+ }
151+ var assembly = registration . Assembly ;
152+ var fullTypeName = registration . FullTypeName ;
153+ return _persistentServiceTypeCache . GetRootType ( assembly , fullTypeName ) ;
154+ }
147155
148156 private sealed class PropertiesAccessor
149157 {
0 commit comments