mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +00:00
added hotfix to serialize base classes
This commit is contained in:
+11
-1
@@ -1773,7 +1773,17 @@ namespace Octokit
|
||||
public static IEnumerable<PropertyInfo> GetProperties(Type type)
|
||||
{
|
||||
#if SIMPLE_JSON_TYPEINFO
|
||||
return type.GetTypeInfo().DeclaredProperties;
|
||||
var typeInfo = type.GetTypeInfo();
|
||||
var properties = typeInfo.DeclaredProperties;
|
||||
|
||||
if (typeInfo.BaseType == null)
|
||||
return properties;
|
||||
|
||||
if (typeInfo.BaseType.FullName == typeof (Object).FullName)
|
||||
return properties;
|
||||
|
||||
var baseProperties = GetProperties(typeInfo.BaseType);
|
||||
return System.Linq.Enumerable.Concat(properties, baseProperties);
|
||||
#else
|
||||
return type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user