mercredi 27 mai 2015

Set properties by reflection

I have this:

foreach (KeyValuePair<string, decimal> update in updates)
{
salesorder.GetType().InvokeMember(update.Key, BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty, Type.DefaultBinder, salesorder, update.Value);
}

I found the example on this site but it was using a string, my example is decimal but it says cannot convert from decimal to object[]

Thanks





Aucun commentaire:

Enregistrer un commentaire