@@ -33,8 +33,8 @@ private enum TypeClassification
33
33
Length ,
34
34
PrecisionScale
35
35
}
36
-
37
- private static readonly string [ ] EmptyAliases = new string [ 0 ] ;
36
+
37
+ public static readonly string [ ] EmptyAliases = new string [ 0 ] ;
38
38
private static readonly char [ ] PrecisionScaleSplit = { '(' , ')' , ',' } ;
39
39
private static readonly char [ ] LengthSplit = { '(' , ')' } ;
40
40
@@ -92,7 +92,15 @@ private enum TypeClassification
92
92
93
93
private delegate NullableType NullableTypeCreatorDelegate ( SqlType sqlType ) ;
94
94
95
- private static void RegisterType ( System . Type systemType , IType nhibernateType , IEnumerable < string > aliases )
95
+ /// <summary>
96
+ /// <para>Defines which NHibernate type should be chosen by default for handling a given .Net type.</para>
97
+ /// <para>This must be done before any operation on NHibernate, including building its
98
+ /// <see cref="Configuration" /> and building session factory. Otherwise the behavior will be undefined.</para>
99
+ /// </summary>
100
+ /// <param name="systemType">The .Net type.</param>
101
+ /// <param name="nhibernateType">The NHibernate type.</param>
102
+ /// <param name="aliases">The additional aliases to map to the type. Use <see cref="EmptyAliases"/> if none.</param>
103
+ public static void RegisterType ( System . Type systemType , IType nhibernateType , IEnumerable < string > aliases )
96
104
{
97
105
var typeAliases = new List < string > ( aliases ) ;
98
106
typeAliases . AddRange ( GetClrTypeAliases ( systemType ) ) ;
@@ -280,25 +288,6 @@ private static void RegisterBuiltInTypes()
280
288
len => new SerializableType ( typeof ( object ) , SqlTypeFactory . GetBinary ( len ) ) ) ) ;
281
289
}
282
290
283
- /// <summary>
284
- /// <para>Defines which NHibernate type should be chosen by default for handling a given .Net type.</para>
285
- /// <para>This must be done before any operation on NHibernate, including building its
286
- /// <see cref="Configuration" /> and building session factory. Otherwise the behavior will be undefined.</para>
287
- /// </summary>
288
- /// <param name="targetType">The NHibernate type.</param>
289
- /// <typeparam name="T">The .Net type.</typeparam>
290
- public static void SetDefaultType < T > ( IType targetType )
291
- {
292
- if ( targetType == null )
293
- throw new ArgumentNullException ( nameof ( targetType ) ) ;
294
-
295
- var type = typeof ( T ) ;
296
- foreach ( var alias in GetClrTypeAliases ( type ) )
297
- {
298
- typeByTypeOfName [ alias ] = targetType ;
299
- }
300
- }
301
-
302
291
private static ICollectionTypeFactory CollectionTypeFactory =>
303
292
Environment . BytecodeProvider . CollectionTypeFactory ;
304
293
0 commit comments