ASP.NET MVC 3和4之间的区别? [英] Difference between ASP.NET MVC 3 and 4?

查看:108
本文介绍了ASP.NET MVC 3和4之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有解释了所有的MVC4的新功能和什么都已经从MVC3改变了COM prehensive列表?

Is there a comprehensive list that explains all of the new features of MVC4 and what all has changed from MVC3?

(参数发行说明都没有太大帮助的)

(The release notes are not much helpful)

推荐答案

复制和 MVC4发行说明<粘贴/一>:

Copied and pasted from MVC4 Release Notes:

现代HTTP编程模型:直接访问和操作使用新的,强类型的HTTP对象模型在Web API的HTTP请求和响应。相同的编程模型和HTTP管道是客户端上的对称可以通过新的HttpClient的类型。

Modern HTTP programming model: Directly access and manipulate HTTP requests and responses in your Web APIs using a new, strongly typed HTTP object model. The same programming model and HTTP pipeline is symmetrically available on the client through the new HttpClient type.

•路由的全面支持:的ASP.NET Web API支持全套ASP.NET路由的路由功能,包括路由参数和约束。此外,使用简单的约定映射动作HTTP方法。

Full support for routes: ASP.NET Web API supports the full set of route capabilities of ASP.NET Routing, including route parameters and constraints. Additionally, use simple conventions to map actions to HTTP methods.

内容协商:客户端和服务器可以一起工作以确定从Web API返回的数据格式正确。的ASP.NET Web API提供了默认支持XML,JSON和Form URL-CN codeD格式,你可以通过添加自己的格式化扩展这种支持,甚至取代默认的内容的谈判策略。

Content negotiation: The client and server can work together to determine the right format for data being returned from a web API. ASP.NET Web API provides default support for XML, JSON, and Form URL-encoded formats and you can extend this support by adding your own formatters, or even replace the default content negotiation strategy.

模型绑定和验证:型粘合剂提供了一种简单的方法来提取从HTTP请求的各个部分的数据和那些消息部分转换为可在Web API操作使用.NET对象。也是基于数据的注释动作参数进行验证。

Model binding and validation: Model binders provide an easy way to extract data from various parts of an HTTP request and convert those message parts into .NET objects which can be used by the Web API actions. Validation is also performed on action parameters based on data annotations.

过滤器:的ASP.NET Web API支持的过滤器,包括著名的过滤器,如[授权]属性。您可以编写和插入的动作,授权和异常处理自己的过滤器。

Filters: ASP.NET Web API supports filters including well-known filters such as the [Authorize] attribute. You can author and plug in your own filters for actions, authorization and exception handling.

查询组成:使用[可查询]筛选器属性在返回的IQueryable启用通过OData的查询约定查询您的Web API支持的动作

Query composition: Use the [Queryable] filter attribute on an action that returns IQueryable to enable support for querying your web API via the OData query conventions.

改善测试:而不是静态上下文对象设置HTTP的细节,网络API操作与Htt的prequestMessage和Htt的presponseMessage的情况下工作。与您的Web API项目快速上手为您的Web API功能编写单元测试创​​建单元测试项目一起。

Improved testability: Rather than setting HTTP details in static context objects, web API actions work with instances of HttpRequestMessage and HttpResponseMessage. Create a unit test project along with your Web API project to get started quickly writing unit tests for your Web API functionality.

code-基于配置:的ASP.NET Web API的配置完全通过code实现的,离开你的配置文件干净。使用提供服务定位器模式来配置扩展点。

Code-based configuration: ASP.NET Web API configuration is accomplished solely through code, leaving your config files clean. Use the provide service locator pattern to configure extensibility points.

的控制反转的改进支持(IOC)容器:ASP.NET的Web API通过改进依赖解析器抽象为IoC容器中,大力支持

Improved support for Inversion of Control (IoC) containers: ASP.NET Web API provides great support for IoC containers through an improved dependency resolver abstraction

自主机:网络的API可以在自己的过程,而仍然使用的路线和Web API的其他功能的全功率主办除了IIS

Self-host: Web APIs can be hosted in your own process in addition to IIS while still using the full power of routes and other features of Web API.

创建自定义帮助和测试网页:您现在可以轻松地通过使用新IApiExplorer服务,让您的网络API的完整的运行时说明建立你的Web API的自定义帮助和测试页面

Create custom help and test pages: You now can easily build custom help and test pages for your web APIs by using the new IApiExplorer service to get a complete runtime description of your web APIs.

监控和诊断:ASP.NET的Web API现在提供重量轻跟踪基础设施,可以方便地与现有的记录解决方案,如System.Diagnostics程序,ETW和第三方日志框架集成。您可以通过提供ITraceWriter实现并将其添加到您的Web API配置启用跟踪。

Monitoring and diagnostics: ASP.NET Web API now provides light weight tracing infrastructure that makes it easy to integrate with existing logging solutions such as System.Diagnostics, ETW and third party logging frameworks. You can enable tracing by providing an ITraceWriter implementation and adding it to your web API configuration.

链接生成:使用的ASP.NET Web API UrlHelper产生在同一应用程序相关资源的链接

Link generation: Use the ASP.NET Web API UrlHelper to generate links to related resources in the same application.

网络API项目模板:选择新的Web API项目形成新的MVC 4项目向导快速起床,用的ASP.NET Web API运行

Web API project template: Select the new Web API project form the New MVC 4 Project wizard to quickly get up and running with ASP.NET Web API.

脚手架:使用添加控制器对话框基于一个基于实体框架模型类型快速脚手架的Web API控制器

Scaffolding: Use the Add Controller dialog to quickly scaffold a web API controller based on an Entity Framework based model type.

这篇关于ASP.NET MVC 3和4之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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