mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 19:46:07 +00:00
get customAttribute for netfx
This commit is contained in:
@@ -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<ParameterAttribute>();
|
||||
#else
|
||||
var attr = type.GetField(name)
|
||||
.GetCustomAttributes(false)
|
||||
.OfType<ParameterAttribute>()
|
||||
.SingleOrDefault();
|
||||
|
||||
#endif
|
||||
if (attr != null)
|
||||
return attr.Value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user