1
1
using System ;
2
2
using System . Collections . Generic ;
3
- using System . Reflection ;
4
3
using System . Linq ;
4
+ using System . Reflection ;
5
5
using FluentNHibernate . Diagnostics ;
6
6
7
7
namespace FluentNHibernate
8
8
{
9
- /// <summary>
10
- /// Facade over an assembly for retrieving type instances.
11
- /// </summary>
12
- public class AssemblyTypeSource : ITypeSource
13
- {
14
- private readonly Assembly source ;
15
-
16
- public AssemblyTypeSource ( Assembly source )
17
- {
18
- this . source = source ;
19
- }
20
-
21
- public IEnumerable < Type > GetTypes ( )
22
- {
23
- return source . GetTypes ( ) . OrderBy ( x => x . FullName ) ;
24
- }
25
-
26
- public void LogSource ( IDiagnosticLogger logger )
27
- {
28
- logger . LoadedFluentMappingsFromSource ( this ) ;
29
- }
30
-
31
- public string GetIdentifier ( )
32
- {
33
- return source . GetName ( ) . FullName ;
34
- }
35
- }
9
+ /// <summary>
10
+ /// Facade over an assembly for retrieving type instances.
11
+ /// </summary>
12
+ public class AssemblyTypeSource : ITypeSource
13
+ {
14
+ readonly Assembly source ;
15
+
16
+ public AssemblyTypeSource ( Assembly source )
17
+ {
18
+ if ( source == null ) throw new ArgumentNullException ( "source" ) ;
19
+
20
+ this . source = source ;
21
+ }
22
+
23
+ #region ITypeSource Members
24
+
25
+ public IEnumerable < Type > GetTypes ( )
26
+ {
27
+ return source . GetTypes ( ) . OrderBy ( x => x . FullName ) ;
28
+ }
29
+
30
+ public void LogSource ( IDiagnosticLogger logger )
31
+ {
32
+ if ( logger == null ) throw new ArgumentNullException ( "logger" ) ;
33
+
34
+ logger . LoadedFluentMappingsFromSource ( this ) ;
35
+ }
36
+
37
+ public string GetIdentifier ( )
38
+ {
39
+ return source . GetName ( ) . FullName ;
40
+ }
41
+
42
+ #endregion
43
+
44
+ public override int GetHashCode ( )
45
+ {
46
+ return source . GetHashCode ( ) ;
47
+ }
48
+ }
36
49
}
0 commit comments