public void SetParameter(string parameterName, object obj, object value)
{
var field = obj.GetType().GetField(parameterName, BindingFlags.Instance | BindingFlags.Public);
var property = obj.GetType().GetProperty(parameterName, BindingFlags.Instance | BindingFlags.Public);
if (field != null)
field.SetValue(obj, value);
else if (property != null && property.CanWrite)
property.SetValue(obj, value);
}