From 2ce46040e7344a2e865d9cc34eda3daf3bc04292 Mon Sep 17 00:00:00 2001 From: prabirshrestha Date: Sun, 5 Jan 2014 14:53:29 -0500 Subject: [PATCH] added ReflectionUtils.GetProperty(type, propertyName) --- src/ReflectionUtils/ReflectionUtils.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ReflectionUtils/ReflectionUtils.cs b/src/ReflectionUtils/ReflectionUtils.cs index 6b93867..e79e7ae 100644 --- a/src/ReflectionUtils/ReflectionUtils.cs +++ b/src/ReflectionUtils/ReflectionUtils.cs @@ -202,6 +202,15 @@ public static IEnumerable GetProperties(Type type) #endif } + public static PropertyInfo GetProperty(Type type, string name) + { +#if REFLECTION_UTILS_TYPEINFO + return type.GetTypeInfo().GetDeclaredProperty(name); +#else + return type.GetProperty(name); +#endif + } + public static IEnumerable GetFields(Type type) { #if REFLECTION_UTILS_TYPEINFO