New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
ASP.NET MVC Updates and New Features
1.
2. About me
0 Chalermpon Areepong
0 Microsoft MVP Thailand (ASP.NET)
0 Work for ICBC THAI
0 Blog http://nine69.wordpress.com
0 User Group
https://www.facebook.com/groups/MVCTHAIDEV
3. AGENDA
0 Enhancement to default project template
0 New Razor 2.0
0 Bundling and Minification
0 ASP.NET WEB APIs
0 Enhanced support for asynchronous methods
0 New Mobile Support
4. Enhancements to Default
Project Templates
0 Design for adaptive rendering to look good in both
desktop browsers and mobile browsers without any
customization.
6. New Razor 2.0
0 Razor now supports conditional attributes. In an
HTML element
<input type="checkbox“ name="check1" value="check1" checked="@checked1" />
0 Support path “~/” for all HTML attributes
10. ASP.NET WEB APIs
0 Change name from WCF Web API
0 Easy to build HTTP services
0 Support Browsers and Mobile devices
0 Build RESTful applications on the .NET Framework
11. ASP.NET WEB APIs
HTTP get, post, etc.
Device App
Request
json, xml, form
ASP.NET
Web App
WEB API
Response
json, xml
Others
HTTP Request
12. ASP.NET WEB APIs
0 Modern HTTP programming model: Directly access and
manipulate HTTP requests and responses in your Web APIs
using a new, strongly typed HTTP object model.
0 Full support for routes:
0 Content negotiation: support for XML, JSON, and Form URL-
encoded formats and custom format.
0 Model binding and validation: like controller base
0 Filters: support filter such as [Authorize]attribute.
0 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.
0 Improved Testability:
use HttpRequestMessage and HttpResponseMessage to create a
unit test project
13. ASP.NET WEB APIs
0 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.
0 Improved support for Inversion of Control (IoC) containers: support
dependency resolver abstraction
0 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.
0 Create custom help and test pages: using the new IApiExplorer service to
get a complete runtime description of your web APIs.
0 Monitoring and diagnostics: System.Diagnostics, ETW and third party
logging frameworks.
0 Link generation: Use the ASP.NET Web API UrlHelper to generate links to
related resources in the same application.
0 Web API project template: new project template
0 Scaffolding: by Add Controller dialog to quickly.
14. Demo
0 Basic Web API
0 SelfHost ( AspNetWebApi.Selfhost )
0 MVC Chat
15. Enhanced support for
asynchronous methods
0 Support Async in .NET Framework 4.5
0 TASK<T>
0 New “async”, “await” keyword
0 Reduce async code
public async Task<ActionResult> GetSocialDatas(string username){
var facebook = new FBService();
var twitter = new TwitterService();
return View(“SocialData",
new SocialDataViewModel {
FBWalls = await facebook.GetWallsAsync(string username),
TwTimeLines = await twitter.GetTimeLineAsync(string username)
});
}
http://wiki.jvmlangsummit.com/images/3/33/Async_in_.NET.pdf