From c1a16ffc74d7284118b27ea0b97fea936429e28b Mon Sep 17 00:00:00 2001 From: Martin Scholz Date: Tue, 21 Jun 2016 19:40:16 +0200 Subject: [PATCH] get customAttribute for netfx --- Octokit/Http/SimpleJsonSerializer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Octokit/Http/SimpleJsonSerializer.cs b/Octokit/Http/SimpleJsonSerializer.cs index 07f59833..825279b5 100644 --- a/Octokit/Http/SimpleJsonSerializer.cs +++ b/Octokit/Http/SimpleJsonSerializer.cs @@ -80,11 +80,14 @@ namespace Octokit.Internal { var type = p.GetType(); var name = Enum.GetName(type, p); +#if NETFX_CORE + var attr = type.GetTypeInfo().GetCustomAttribute(); +#else var attr = type.GetField(name) .GetCustomAttributes(false) .OfType() .SingleOrDefault(); - +#endif if (attr != null) return attr.Value;