@@ -79,9 +79,9 @@ public TypeInfo CreateProxyType(System.Type baseType, IReadOnlyCollection<System
79
79
var typeBuilder = moduleBuilder . DefineType ( typeName , typeAttributes , parentType , interfaces . ToArray ( ) ) ;
80
80
81
81
var lazyInitializerField = typeBuilder . DefineField ( "__lazyInitializer" , LazyInitializerType , FieldAttributes . Private ) ;
82
- var proxyFactoryField = typeBuilder . DefineField ( "_proxyFactory " , typeof ( IProxyFactory ) , FieldAttributes . Private ) ;
82
+ var proxyInfoField = typeBuilder . DefineField ( "_proxyInfo " , typeof ( NHibernateProxyFactoryInfo ) , FieldAttributes . Private ) ;
83
83
84
- ImplementConstructor ( typeBuilder , parentType , lazyInitializerField , proxyFactoryField ) ;
84
+ ImplementConstructor ( typeBuilder , parentType , lazyInitializerField , proxyInfoField ) ;
85
85
86
86
// Provide a custom implementation of ISerializable
87
87
// instead of redirecting it back to the interceptor
@@ -96,7 +96,7 @@ public TypeInfo CreateProxyType(System.Type baseType, IReadOnlyCollection<System
96
96
typeBuilder . SetCustomAttribute ( customAttributeBuilder ) ;
97
97
98
98
ImplementDeserializationConstructor ( typeBuilder ) ;
99
- ImplementGetObjectData ( typeBuilder , proxyFactoryField ) ;
99
+ ImplementGetObjectData ( typeBuilder , proxyInfoField ) ;
100
100
101
101
var proxyType = typeBuilder . CreateTypeInfo ( ) ;
102
102
@@ -105,9 +105,9 @@ public TypeInfo CreateProxyType(System.Type baseType, IReadOnlyCollection<System
105
105
return proxyType ;
106
106
}
107
107
108
- static void ImplementConstructor ( TypeBuilder typeBuilder , System . Type parentType , FieldInfo lazyInitializerField , FieldInfo proxyFactoryField )
108
+ static void ImplementConstructor ( TypeBuilder typeBuilder , System . Type parentType , FieldInfo lazyInitializerField , FieldInfo proxyInfoField )
109
109
{
110
- var constructor = typeBuilder . DefineConstructor ( constructorAttributes , CallingConventions . Standard , new [ ] { LazyInitializerType , typeof ( IProxyFactory ) } ) ;
110
+ var constructor = typeBuilder . DefineConstructor ( constructorAttributes , CallingConventions . Standard , new [ ] { LazyInitializerType , typeof ( NHibernateProxyFactoryInfo ) } ) ;
111
111
112
112
var baseConstructor = parentType . GetConstructor ( BindingFlags . Instance | BindingFlags . NonPublic | BindingFlags . Public , null , System . Type . EmptyTypes , null ) ;
113
113
@@ -129,7 +129,7 @@ static void ImplementConstructor(TypeBuilder typeBuilder, System.Type parentType
129
129
130
130
IL . Emit ( OpCodes . Ldarg_0 ) ;
131
131
IL . Emit ( OpCodes . Ldarg_2 ) ;
132
- IL . Emit ( OpCodes . Stfld , proxyFactoryField ) ;
132
+ IL . Emit ( OpCodes . Stfld , proxyInfoField ) ;
133
133
134
134
IL . Emit ( OpCodes . Ret ) ;
135
135
}
@@ -145,7 +145,7 @@ static void ImplementDeserializationConstructor(TypeBuilder typeBuilder)
145
145
IL . Emit ( OpCodes . Ret ) ;
146
146
}
147
147
148
- static void ImplementGetObjectData ( TypeBuilder typeBuilder , FieldInfo proxyFactoryField )
148
+ static void ImplementGetObjectData ( TypeBuilder typeBuilder , FieldInfo proxyInfoField )
149
149
{
150
150
const MethodAttributes attributes = MethodAttributes . Public | MethodAttributes . HideBySig |
151
151
MethodAttributes . Virtual ;
@@ -163,9 +163,9 @@ static void ImplementGetObjectData(TypeBuilder typeBuilder, FieldInfo proxyFacto
163
163
IL . Emit ( OpCodes . Call , ReflectionCache . TypeMethods . GetTypeFromHandle ) ;
164
164
IL . Emit ( OpCodes . Callvirt , ProxyFactory . setType ) ;
165
165
166
- //this.__proxyFactory
166
+ //this._proxyInfo
167
167
IL . Emit ( OpCodes . Ldarg_0 ) ;
168
- IL . Emit ( OpCodes . Ldfld , proxyFactoryField ) ;
168
+ IL . Emit ( OpCodes . Ldfld , proxyInfoField ) ;
169
169
170
170
//this.LazyInitializer.Identifier
171
171
EmitGetLazyInitializer ( IL ) ;
@@ -174,7 +174,7 @@ static void ImplementGetObjectData(TypeBuilder typeBuilder, FieldInfo proxyFacto
174
174
var constructor = typeof ( NHibernateProxyObjectReference ) . GetConstructor (
175
175
new [ ]
176
176
{
177
- typeof ( IProxyFactory ) ,
177
+ typeof ( NHibernateProxyFactoryInfo ) ,
178
178
typeof ( object ) ,
179
179
} ) ;
180
180
IL . Emit ( OpCodes . Newobj , constructor ) ;
0 commit comments