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 33using System . Reflection ;
44using System . Reflection . Emit ;
55using NHibernate . Engine ;
6- using NHibernate . Intercept ;
7- using NHibernate . Proxy ;
8- using NHibernate . Proxy . DynamicProxy ;
96using NHibernate . Util ;
107
118namespace NHibernate . Properties
@@ -157,22 +154,6 @@ private string GetFieldName(string propertyName)
157154 }
158155 }
159156
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-
176157 /// <summary>
177158 /// An <see cref="IGetter"/> that uses a Field instead of the Property <c>get</c>.
178159 /// </summary>
@@ -209,7 +190,7 @@ public object Get(object target)
209190 {
210191 try
211192 {
212- return field . GetValue ( GetTarget ( target ) ) ;
193+ return field . GetValue ( target ) ;
213194 }
214195 catch ( Exception e )
215196 {
@@ -294,7 +275,7 @@ public void Set(object target, object value)
294275 {
295276 try
296277 {
297- field . SetValue ( GetTarget ( target ) , value ) ;
278+ field . SetValue ( target , value ) ;
298279 }
299280 catch ( ArgumentException ae )
300281 {
You can’t perform that action at this time.
0 commit comments