public static FieldAccesor Get(Type type, string fieldName) { var fullName = $"{type.FullName}.{fieldName}"; FieldAccesor result; if (!_accessors.TryGetValue(fullName, out result)) { result = new FieldAccesor(type, fieldName); _accessors.TryAdd(fullName, result); } return(result); }
public static object GetValue(object target, string fieldName) { FieldAccesor field = new FieldAccesor(target, fieldName); return(field.Get()); }