A
Andrus
I need to get type t properies in the native order as they appear in class
definition .cs file.
Type t has full-property constructor whose parameters are all properties in
native order.
I tried
public static PropertyInfo[] GetProjectionDataInNativeOrder(Type t) {
PropertyInfo[] props = t.GetProperties();
return props;
}
First call returns properties in proper order.
After some objects of type t are created and their properties accessed
GetProperties() returns props in different order.
How to force this code to return properties in native order always ?
How to change this code so it caches result of first GetProperties() call
for every type and returns previous value returned by GetProperties() ?
Is the property order always native in this case ?
Or any other soution ?
Andrus.
definition .cs file.
Type t has full-property constructor whose parameters are all properties in
native order.
I tried
public static PropertyInfo[] GetProjectionDataInNativeOrder(Type t) {
PropertyInfo[] props = t.GetProperties();
return props;
}
First call returns properties in proper order.
After some objects of type t are created and their properties accessed
GetProperties() returns props in different order.
How to force this code to return properties in native order always ?
How to change this code so it caches result of first GetProperties() call
for every type and returns previous value returned by GetProperties() ?
Is the property order always native in this case ?
Or any other soution ?
Andrus.