File tree 4 files changed +35
-129
lines changed
4 files changed +35
-129
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ string ValueToStrings()
179
179
{
180
180
return value . ToString ( ) ;
181
181
}
182
- return ObjectUtils . IdentityToString ( value ) ;
182
+ return ObjectHelpers . IdentityToString ( value ) ;
183
183
}
184
184
}
185
185
}
Original file line number Diff line number Diff line change 709
709
<Compile Include =" Util\EnumeratorAdapter.cs" />
710
710
<Compile Include =" Util\IdentityMap.cs" />
711
711
<Compile Include =" Util\JoinedEnumerable.cs" />
712
- <Compile Include =" Util\ObjectUtils .cs" />
712
+ <Compile Include =" Util\ObjectHelpers .cs" />
713
713
<Compile Include =" Util\PropertiesHelper.cs" />
714
714
<Compile Include =" Util\ReflectHelper.cs" />
715
715
<Compile Include =" Util\SequencedHashMap.cs" />
Original file line number Diff line number Diff line change
1
+
2
+ namespace NHibernate . Util
3
+ {
4
+ /// <summary>
5
+ /// Various small helper methods.
6
+ /// </summary>
7
+ public static class ObjectHelpers
8
+ {
9
+ /// <summary>
10
+ /// Return an identifying string representation for the object, taking
11
+ /// NHibernate proxies into account. The returned string will be "null",
12
+ /// "classname@hashcode(hash)", or "entityname#identifier". If the object
13
+ /// is an uninitialized NHibernate proxy, take care not to initialize it.
14
+ /// </summary>
15
+ public static string IdentityToString ( object obj )
16
+ {
17
+ if ( obj == null )
18
+ {
19
+ return "null" ;
20
+ }
21
+
22
+ var proxy = obj as Proxy . INHibernateProxy ;
23
+
24
+ if ( null != proxy )
25
+ {
26
+ var init = proxy . HibernateLazyInitializer ;
27
+ return StringHelper . Unqualify ( init . EntityName ) + "#" + init . Identifier ;
28
+ }
29
+
30
+ return StringHelper . Unqualify ( obj . GetType ( ) . FullName ) + "@" + obj . GetHashCode ( ) + "(hash)" ;
31
+ }
32
+ }
33
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments