MVC 6视图组件 [英] MVC 6 View Components

查看:140
本文介绍了MVC 6视图组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MVC 6有一个名为View组件这似乎是部分景色更好的替代功能的新领域。我已经看到下面的 View组件实例。但似乎没有更多的信息目前对它们的使用情况。

In 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.

的更多信息请访问:

  • Exciting Things About ASP.NET vNext Series: MVC View Components

有关甜甜圈缓存,有两个独立的问题提起,你可以发表评论/曲目:#1232 和< A HREF =htt​​ps://github.com/aspnet/Mvc/issues/536>#536

For donut caching, there are two separate issues filed that you can comment/track: #1232 and #536

这篇关于MVC 6视图组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆