11using System ;
22using System . Collections . Generic ;
33using System . Dynamic ;
4+ using System . Linq ;
45using System . Reflection ;
56using System . Runtime . CompilerServices ;
7+ using ServiceStack . OrmLite ;
68
79namespace ServiceStack . Razor . Compilation
810{
@@ -22,7 +24,7 @@ public static class CompilerServices
2224 public static bool IsAnonymousType ( Type type )
2325 {
2426 if ( type == null )
25- throw new ArgumentNullException ( " type" ) ;
27+ throw new ArgumentNullException ( nameof ( type ) ) ;
2628
2729 return ( type . IsClass
2830 && type . IsSealed
@@ -39,7 +41,7 @@ public static bool IsAnonymousType(Type type)
3941 public static bool IsDynamicType ( Type type )
4042 {
4143 if ( type == null )
42- throw new ArgumentNullException ( " type" ) ;
44+ throw new ArgumentNullException ( nameof ( type ) ) ;
4345
4446 return ( DynamicType . IsAssignableFrom ( type )
4547 || ExpandoType . IsAssignableFrom ( type )
@@ -54,7 +56,7 @@ public static bool IsDynamicType(Type type)
5456 public static IEnumerable < ConstructorInfo > GetConstructors ( Type type )
5557 {
5658 if ( type == null )
57- throw new ArgumentNullException ( " type" ) ;
59+ throw new ArgumentNullException ( nameof ( type ) ) ;
5860
5961 var constructors = type
6062 . GetConstructors ( BindingFlags . Public | BindingFlags . Instance ) ;
@@ -69,7 +71,14 @@ public static IEnumerable<ConstructorInfo> GetConstructors(Type type)
6971 public static IEnumerable < Assembly > GetLoadedAssemblies ( )
7072 {
7173 var domain = AppDomain . CurrentDomain ;
72- return domain . GetAssemblies ( ) ;
74+ var dlls = domain . GetAssemblies ( ) . ToList ( ) ;
75+
76+ if ( dlls . All ( x => x != typeof ( OrmLiteConfig ) . Assembly ) )
77+ {
78+ dlls . Add ( typeof ( OrmLiteConfig ) . Assembly ) ;
79+ }
80+
81+ return dlls ;
7382 }
7483 }
7584}
0 commit comments