Dynamic typed ViewPage

后端 未结 4 1100
无人及你
无人及你 2020-12-30 07:14

Is this possible? Here\'s what I\'m trying:

    public ActionResult Index()
    {
        dynamic p = new { Name = \"Test\", Phone = \"111-2222\" };
                


        
4条回答
  •  粉色の甜心
    2020-12-30 07:35

    On .NET 4.0 Anonymous types can easily be converted to ExpandoObjects and thus all the problems is fixed with the overhead of the conversion itself. Check out here

提交回复
热议问题