Hi, i successfully migrate my project from RC1 to RC2 but i have a issue with Components. I change
@Component.Invoke("ContactField")
to
@Component.InvokeAsync("ContactField")
.
But now in view i have text -> System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Html.IHtmlContent]
What can i do with this issue?
Im not sure if you can await in a razorview, but if not use @Component.InvokeAsync("ContactField").Result to get the underlaying Result of the Task.
Thanks :)
Announcement for this change here: https://github.com/aspnet/Announcements/issues/145
You just need to await the result:
@await Component.InvokeAsync("ContactField")
Most helpful comment
Im not sure if you can await in a razorview, but if not use @Component.InvokeAsync("ContactField").Result to get the underlaying Result of the Task.