230 likes | 449 Views
New features in ASP.NET 4.5. MVC4 WebAPI VS2012 async / await SignalR. Jakub Jedryszek jakub.jedryszek@gmail.com. AGENDA. ASP.NET MVC 4 Web API Database migrations Bundling & Minification Oauth Visual Studio 2012 Improved editors : HTML , CSS i JavaScript
E N D
New features in ASP.NET 4.5 MVC4 WebAPI VS2012 async/awaitSignalR Jakub Jedryszek jakub.jedryszek@gmail.com
AGENDA • ASP.NET MVC 4 • Web API • Database migrations • Bundling & Minification • Oauth • Visual Studio 2012 • Improvededitors: HTML, CSS i JavaScript • Web Publishing improvements • PageInspector • async/await • SignalR& WebSockets
.NET 4.5 Released on 15 August 2012 Supportedonly on Windows Vista orlater .NET for Metro style apps Not supported in Visual Studio 2010 Built-in Visual Studio 2012
Top ASP.NET 4.5 and Visual Studio 2012 features • ASP.NET MVC4 • ASP.NET WebAPI • Database migrations Bundling&Optimization • Oauth • Visual Studio 2012 • Metro style • HTML/CSS/JS Editors • Web Publishing • PageInspector SignalR & WebSockets async and await
ASP.NET MVC 4 New project templates Razorimprovements Bundling and minification Mobile features = Display modes Database migrations OAuth ASP.NET Web API
NEW DEFAULT TEMPLATES MVC 3 MVC 4
NEW DEFAULT TEMPLATES Empty (MVC 3) Empty (MVC 4) Basic (MVC 4)
RAZOR IMPROVEMENTS Resolving~/withinall standard HTML attributes In MVC3: In MVC4:
RAZOR IMPROVEMENTS Auto-ignoreattributes with nullvalue In MVC3: In MVC4:
BUNDLING AND MINIFICATION Bundling – bundlemultiplefilesinto a single file Minification – removewhitespaces, comments and shorteringvariablenames to one character
MOBILE FEATURES = DISPLAY MODES • Overridelayout, views, and partial views (globally or/and for an individual view) • Control over layout and partial override enforcement using the RequireConsistentDisplayModeproperty • A view-switcher widget for mobile views than can also be displayed in desktop views • Support for specific browsers, such as the iPhone browser
DATABASE MIGRATIONS PM>Enable-Migrations PM>Add-Migration MyMigration PM> Update-Database PM>Update-Database –TargetMigrationMyMigration PM> Update-Database –Verbose PM> Update-Database –Script –SourceMigration:$InitialDatabase –TargetMigration:MyMigration
DATABASE MIGRATIONS - AUTOMIGRATIONS 1. Enable auto migrations 2. Set DB initializer
OAUTH Login with: Facebook: http://developers.facebook.com/ Twitter: http://dev.twitter.com/ Google: http://developers.google.com/ Microsoft: http://manage.dev.live.com/
ASP.NET Web API Framework for creating HTTP services RESTful GET, POST, PUT, DELETE Format: JSON/XML
Visual Studio 2012 Quicklaunch New Metro style layout IIS Express for Web Development Improvededitors for HTML, CSS and JavaScript Web Publishimprovements PageInspector
SignalR & WebSockets Persistentconnectionclient-server Design for buildmulti-user, real-time web applcations Allowsserver-to-clientpush and RPC Scalable (100 000 messages per second) Auto negotitateconnection Server sentevents (EventSource)
RESOURCES • ASP.NET website: www.asp.net • MVC4: http://www.asp.net/mvc/tutorials/mvc-4 • Channel9: http://channel9.msdn.com • Scott Hanselman – 5 minute videos about ASP.NET 4.5 and VS2012: http://www.hanselman.com/blog/VisualStudio2012AndNETFramework45IsRELEASEDHeres5MinuteVideosToGetYouUpToSpeedQuick.aspx • Randy Pausch – Last Lecture: http://www.youtube.com/watch?v=FY1vz5b_aXE • Top 13+ mustread: http://webhosting.pl/13_.ksiazek.hakerow.i.nie.tylko.ktore.powinien.przeczytac.kazdy.programista