@@ -35,7 +35,7 @@ private enum TypeClassification
35
35
}
36
36
37
37
private static readonly IInternalLogger _log = LoggerProvider . LoggerFor ( typeof ( TypeFactory ) ) ;
38
- private static readonly string [ ] EmptyAliases = new string [ 0 ] ;
38
+ public static readonly string [ ] EmptyAliases = new string [ 0 ] ;
39
39
private static readonly char [ ] PrecisionScaleSplit = { '(' , ')' , ',' } ;
40
40
private static readonly char [ ] LengthSplit = { '(' , ')' } ;
41
41
@@ -96,7 +96,15 @@ private enum TypeClassification
96
96
97
97
private delegate NullableType NullableTypeCreatorDelegate ( SqlType sqlType ) ;
98
98
99
- private static void RegisterType ( System . Type systemType , IType nhibernateType , IEnumerable < string > aliases )
99
+ /// <summary>
100
+ /// <para>Defines which NHibernate type should be chosen by default for handling a given .Net type.</para>
101
+ /// <para>This must be done before any operation on NHibernate, including building its
102
+ /// <see cref="Configuration" /> and building session factory. Otherwise the behavior will be undefined.</para>
103
+ /// </summary>
104
+ /// <param name="systemType">The .Net type.</param>
105
+ /// <param name="nhibernateType">The NHibernate type.</param>
106
+ /// <param name="aliases">The additional aliases to map to the type. Use <see cref="EmptyAliases"/> if none.</param>
107
+ public static void RegisterType ( System . Type systemType , IType nhibernateType , IEnumerable < string > aliases )
100
108
{
101
109
var typeAliases = new List < string > ( aliases ) ;
102
110
typeAliases . AddRange ( GetClrTypeAliases ( systemType ) ) ;
@@ -314,25 +322,6 @@ private static void RegisterBuiltInTypes()
314
322
len => new SerializableType ( typeof ( object ) , SqlTypeFactory . GetBinary ( len ) ) ) ) ;
315
323
}
316
324
317
- /// <summary>
318
- /// <para>Defines which NHibernate type should be chosen by default for handling a given .Net type.</para>
319
- /// <para>This must be done before any operation on NHibernate, including building its
320
- /// <see cref="Configuration" /> and building session factory. Otherwise the behavior will be undefined.</para>
321
- /// </summary>
322
- /// <param name="targetType">The NHibernate type.</param>
323
- /// <typeparam name="T">The .Net type.</typeparam>
324
- public static void SetDefaultType < T > ( IType targetType )
325
- {
326
- if ( targetType == null )
327
- throw new ArgumentNullException ( nameof ( targetType ) ) ;
328
-
329
- var type = typeof ( T ) ;
330
- foreach ( var alias in GetClrTypeAliases ( type ) )
331
- {
332
- typeByTypeOfName [ alias ] = targetType ;
333
- }
334
- }
335
-
336
325
private static ICollectionTypeFactory CollectionTypeFactory =>
337
326
Environment . BytecodeProvider . CollectionTypeFactory ;
338
327
0 commit comments