From 12beae723138afb82f04fcc3d121a60122d8b0a0 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Thu, 23 Jan 2014 15:28:13 -0800 Subject: [PATCH] workaround for how TypeInfo is terrible --- Octokit/SimpleJson.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Octokit/SimpleJson.cs b/Octokit/SimpleJson.cs index 9e772159..b8300f34 100644 --- a/Octokit/SimpleJson.cs +++ b/Octokit/SimpleJson.cs @@ -51,6 +51,7 @@ using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; +using System.Linq; #if !SIMPLE_JSON_NO_LINQ_EXPRESSION using System.Linq.Expressions; #endif @@ -1726,7 +1727,13 @@ namespace Octokit public static IEnumerable GetProperties(Type type) { #if SIMPLE_JSON_TYPEINFO - return type.GetTypeInfo().DeclaredProperties; + var info = type.GetTypeInfo(); + + var baseProperties = info.BaseType != null && info.BaseType != typeof(Object) + ? GetProperties(info.BaseType) + : new PropertyInfo[0]; + + return info.DeclaredProperties.Concat(baseProperties); #else return type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); #endif