File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed
src/NHibernate/Properties Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change 3
3
using System . Reflection ;
4
4
using System . Reflection . Emit ;
5
5
using NHibernate . Engine ;
6
- using NHibernate . Intercept ;
7
- using NHibernate . Proxy ;
8
- using NHibernate . Proxy . DynamicProxy ;
9
6
using NHibernate . Util ;
10
7
11
8
namespace NHibernate . Properties
@@ -157,22 +154,6 @@ private string GetFieldName(string propertyName)
157
154
}
158
155
}
159
156
160
- private static object GetTarget ( object maybeProxy )
161
- {
162
- //wish there were an interface to unwrap with
163
- var proxy = maybeProxy as IProxy ;
164
- if ( proxy != null )
165
- {
166
- var fieldInterceptor = proxy . Interceptor as DefaultDynamicLazyFieldInterceptor ;
167
- if ( fieldInterceptor != null )
168
- {
169
- return fieldInterceptor . TargetInstance ;
170
- }
171
- }
172
-
173
- return maybeProxy ;
174
- }
175
-
176
157
/// <summary>
177
158
/// An <see cref="IGetter"/> that uses a Field instead of the Property <c>get</c>.
178
159
/// </summary>
@@ -209,7 +190,7 @@ public object Get(object target)
209
190
{
210
191
try
211
192
{
212
- return field . GetValue ( GetTarget ( target ) ) ;
193
+ return field . GetValue ( target ) ;
213
194
}
214
195
catch ( Exception e )
215
196
{
@@ -294,7 +275,7 @@ public void Set(object target, object value)
294
275
{
295
276
try
296
277
{
297
- field . SetValue ( GetTarget ( target ) , value ) ;
278
+ field . SetValue ( target , value ) ;
298
279
}
299
280
catch ( ArgumentException ae )
300
281
{
You can’t perform that action at this time.
0 commit comments