private static MetaAccessor MakeMemberAccessor(Type accessorType, MemberInfo member, MetaAccessor storageAccessor) { var field = member as FieldInfo; if (field != null) { return(FieldAccessor.Create(accessorType, field)); } var property = (PropertyInfo)member; return(PropertyAccessor.Create(accessorType, property, storageAccessor)); }
private static MetaAccessor MakeMemberAccessor(Type accessorType, MemberInfo mi) { FieldInfo fi = mi as FieldInfo; MetaAccessor acc = null; if (fi != null) { acc = FieldAccessor.Create(accessorType, fi); } else { PropertyInfo pi = (PropertyInfo)mi; acc = PropertyAccessor.Create(accessorType, pi, null); } return(acc); }