I have a situation where I would like to do something simular to what was done with the ASP.NET MVC 3 ViewBag object where properties are created at runtime? Or is it at compile time?
Anyway I was wondering how to go about creating an object with this behaviour?
Use an object of type dynamic
. See this article for more information.