ASP.NET Core MVC视图组件 [英] ASP.NET Core MVC View Components
问题描述
在ASP.NET Core MVC(以前称为MVC 6)中,有一个称为视图组件"的新功能领域,它似乎是部分视图的更好替代方案.我看过以下查看组件示例.但是目前关于它们的用法似乎没有更多的信息.
我正在尝试评估是否值得使用此模式,以及是否可以/(或打算)将其用作更成熟的方法来帮助解决方案
视图组件绝对很棒,而且肯定是一个改进.一项重大改进是,您可以在视图组件上运行异步操作,而子操作是不可能的.>
更多可用信息,在这里:
对于甜甜圈缓存,有两个单独的问题可供您评论/跟踪:#1232 和#536
In ASP.NET Core MVC (formerly MVC 6) there is a new area of functionality called View Components which appear to be a better alternative to Partial Views. I've seen the following View Component Example. But there doesn't seem much more information currently as to their usage.
I'm trying to evaluate if its worth using this pattern and if this can/(or is intended) to be used as a more baked in method to help with donut caching.
View components are definitively great and it's certainly an improvement. The one big improvement is that you can run asynchronous operations on view components where it wasn't possible with child actions.
More information available here:
For donut caching, there are two separate issues filed that you can comment/track: #1232 and #536
这篇关于ASP.NET Core MVC视图组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!