In the case of ExpandoObject, the ExpandoObject class actually implements IDictionary<string, object>
for its properties, so the solution is as trivial as casting:
IDictionary<string, object> propertyValues = (IDictionary<string, object>)s;
Note that this will not work for general dynamic objects. In these cases you will need to drop down to the DLR via IDynamicMetaObjectProvider.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…