Hi,
This code throws RuntimeBinderException (Additional information: 'System.Dynamic.ExpandoObject' does not contain a definition for 'price')
var engine = EngineFactory.CreatePhysical("D:\\views");
var obj = new ExpandoObject();
dynamic dynamicObj = obj;
dynamicObj.price = 30;
engine.Parse("test.cshtml", obj);
I believe problem occurs because of this line:
https://github.com/toddams/RazorLight/blob/master/src/RazorLight/ModelTypeInfo.cs#L42
Seems that ToExpando() doesn't handle ExpandoObject parameter correctly, as it returns new empty ExpandoObject as a result.
Thanks!
That's right, ToExpando() method expects to receive anonymous object and convert it to ExpandoObject.
I will add additional check, thanks
Most helpful comment
That's right, ToExpando() method expects to receive anonymous object and convert it to ExpandoObject.
I will add additional check, thanks