This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,13 @@ static TypeFields()
6565 }
6666 }
6767 }
68+
69+ public static TypeFieldInfo GetAccessor ( string propertyName )
70+ {
71+ return Instance . FieldsMap . TryGetValue ( propertyName , out TypeFieldInfo info )
72+ ? info
73+ : null ;
74+ }
6875 }
6976
7077 public abstract class TypeFields
@@ -96,6 +103,13 @@ public static TypeFields Get(Type type)
96103 return instance ;
97104 }
98105
106+ public TypeFieldInfo GetAccessor ( string propertyName )
107+ {
108+ return FieldsMap . TryGetValue ( propertyName , out TypeFieldInfo info )
109+ ? info
110+ : null ;
111+ }
112+
99113 public Type Type { get ; protected set ; }
100114
101115 public readonly Dictionary < string , TypeFieldInfo > FieldsMap =
Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ static TypeProperties()
5858 }
5959 }
6060 }
61+
62+ public static TypePropertyInfo GetAccessor ( string propertyName )
63+ {
64+ return Instance . PropertyMap . TryGetValue ( propertyName , out TypePropertyInfo info )
65+ ? info
66+ : null ;
67+ }
6168 }
6269
6370 public abstract class TypeProperties
@@ -89,6 +96,13 @@ public static TypeProperties Get(Type type)
8996 return instance ;
9097 }
9198
99+ public TypePropertyInfo GetAccessor ( string propertyName )
100+ {
101+ return PropertyMap . TryGetValue ( propertyName , out TypePropertyInfo info )
102+ ? info
103+ : null ;
104+ }
105+
92106 public Type Type { get ; protected set ; }
93107
94108 public readonly Dictionary < string , TypePropertyInfo > PropertyMap =
You can’t perform that action at this time.
0 commit comments