Hi,
I have an method that takes in an observable collection (returned from a webservice) of objects and analyzes them according to their attributes.
Here is the code snippet from the method
private double analyze(ObservableCollection mobjColl) {
FieldInfo fi = null;
foreach (MyApp.MyObj oi in mobjColl)
{
if(oi.pressure.Equals("high"){
fi = oi.GetType().GetField("air");
.....
}
}
return someval;
}
My problem is that the fieldinfo fi is always null. I can access every field of the object (within foreach) using the objects name however the fieldinfo object is never populated. I even tried using GetFields method but it does not return an array...
P.S : the object fields are public. Using bindingflags in getfield didnt help either.