I am trying to set the properties of one object to be the same as the properties of another object. Here the code so far:

```
private T SetObjectAttributes<T> (dynamic fromO, T toO)
{
    foreach (var prop in fromO.GetType().GetProperties())
    {
        toO[prop] = fromO[prop];
    }
    return toO;
}

```

The syntax here is incorrect:

```
toDbObject[prop] = fromObject[prop];

```

Basically, I am trying to set a property but the property name isn't known until run time. So my question is how to assign the value of the property at runtime.