@@ -228,20 +228,20 @@ private void CreateNodeTree(List<object> values, ref XmlDocument document, strin
228228 var depth = 1 ;
229229 XmlNode itemNode = document . CreateElement ( "Item" + itemIndex ) ;
230230
231- if ( value == null || ! value . GetType ( ) . IsGenericType || ( value . GetType ( ) . IsGenericType && value . GetType ( ) . CachedGetGenericTypeDefinition ( ) != typeof ( Grouping < , > ) ) ) {
231+ if ( value == null || ! value . GetType ( ) . IsGenericType || ( value . GetType ( ) . IsGenericType && value . GetType ( ) . GetGenericTypeDefinition ( ) != typeof ( Grouping < , > ) ) ) {
232232 itemNode = document . CreateElement ( "Item" + itemIndex ) ;
233233 itemIndex ++ ;
234234 parentNode . AppendChild ( itemNode ) ;
235235 }
236236
237237 if ( value == null || ( ( GetMemberType ( value . GetType ( ) ) == MemberType . Primitive
238238 || GetMemberType ( value . GetType ( ) ) == MemberType . Unknown ) && ! value . GetType ( ) . IsGenericType )
239- || ( value . GetType ( ) . IsGenericType && value . GetType ( ) . CachedGetGenericTypeDefinition ( ) != typeof ( Grouping < , > ) )
239+ || ( value . GetType ( ) . IsGenericType && value . GetType ( ) . GetGenericTypeDefinition ( ) != typeof ( Grouping < , > ) )
240240 && ( GetMemberType ( value . GetType ( ) ) == MemberType . Primitive
241241 || GetMemberType ( value . GetType ( ) ) == MemberType . Unknown ) )
242242 depth = AddNode ( value , null , ref document , itemNode , depth ) ;
243243
244- else if ( value . GetType ( ) . IsGenericType && value . GetType ( ) . CachedGetGenericTypeDefinition ( ) == typeof ( Grouping < , > ) ) {
244+ else if ( value . GetType ( ) . IsGenericType && value . GetType ( ) . GetGenericTypeDefinition ( ) == typeof ( Grouping < , > ) ) {
245245 var exactValue = ( IEnumerable ) value ;
246246 foreach ( var val in exactValue ) {
247247 itemNode = document . CreateElement ( "Item" + itemIndex ) ;
@@ -299,8 +299,8 @@ private int AddNode(object value, PropertyInfo property, ref XmlDocument documen
299299
300300 else {
301301 if ( property . PropertyType . IsGenericType &&
302- ( property . PropertyType . CachedGetGenericTypeDefinition ( ) == typeof ( IQueryable < > )
303- || ( property . PropertyType . CachedGetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) ) ) ) {
302+ ( property . PropertyType . GetGenericTypeDefinition ( ) == typeof ( IQueryable < > )
303+ || ( property . PropertyType . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) ) ) ) {
304304 var enumerable = ( IEnumerable ) property . GetValue ( value , property . GetIndexParameters ( ) ) ;
305305 var list = new List < object > ( ) ;
306306 foreach ( var o in enumerable )
@@ -559,7 +559,7 @@ private static void EnumerateAll(IEnumerable enumerable)
559559 if ( o != null ) {
560560 var type = o . GetType ( ) ;
561561 if ( type . IsGenericType ) {
562- var genericTypeDefinition = type . CachedGetGenericTypeDefinition ( ) ;
562+ var genericTypeDefinition = type . GetGenericTypeDefinition ( ) ;
563563 if ( genericTypeDefinition == typeof ( IQueryable < > )
564564 || genericTypeDefinition == typeof ( IEnumerable < > )
565565 || genericTypeDefinition == typeof ( SubQuery < > )
@@ -570,10 +570,10 @@ private static void EnumerateAll(IEnumerable enumerable)
570570 var properties = type . GetProperties ( ) ;
571571 foreach ( var info in properties ) {
572572 if ( info . PropertyType . IsGenericType &&
573- ( info . PropertyType . CachedGetGenericTypeDefinition ( ) == typeof ( IQueryable < > )
574- || info . PropertyType . CachedGetGenericTypeDefinition ( ) == typeof ( IEnumerable < > )
575- || info . PropertyType . CachedGetGenericTypeDefinition ( ) == typeof ( SubQuery < > )
576- || info . PropertyType . CachedGetGenericTypeDefinition ( ) == typeof ( Grouping < , > )
573+ ( info . PropertyType . GetGenericTypeDefinition ( ) == typeof ( IQueryable < > )
574+ || info . PropertyType . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > )
575+ || info . PropertyType . GetGenericTypeDefinition ( ) == typeof ( SubQuery < > )
576+ || info . PropertyType . GetGenericTypeDefinition ( ) == typeof ( Grouping < , > )
577577 ) )
578578 EnumerateAll ( ( IEnumerable ) info . GetValue ( o , null ) ) ;
579579 }
0 commit comments