I modified the example that comes with the new version of Roslyn that was released yesterday to use dynamic and ExpandoObject but I am getting a compiler error which I am no
ASP.NET MVC specific:
You can get this error in an MVC 6 controller if you forget to put [FromBody]
in a POST
method.
[HttpPost("[action]")]
public void RunReport([FromBody]dynamic report)
{
...
}
The .NETCore default project already includes Microsoft.CSharp
reference but you get pretty much the same message.
With [FromBody]
added you can now post JSON and then just dynamically access the properties :-)