Hi
Using anonymos Types as dynamc paramater is working in C' 6.0
Example (works in Linqpad):
void Main() { dynamic dyn = new { Prop ="Hallo World" }; myFunction(dyn); } public void myFunction(dynamic dyn) { Console.WriteLine(dyn.Prop); }
If i try to do this in ASP.net MVC 6 ViewComponent
Controler:
public IViewComponentResult Invoke(int shortTermId) { dynamic shortTerm = new { Name = "Hallo World", }; return View(shortTerm); }
ViewComponent:
@model dynamic<!--left--><div class="vertTextContainer2"><p class="vertical-text2">@Model.Name</p></div>
Bring up an Binding Error