Your SlideShare is downloading. ×
Mvc 4.0
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Mvc 4.0

228
views

Published on

ASP.NET MVC 4.0 Training PPT

ASP.NET MVC 4.0 Training PPT

Published in: Software, Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
228
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ASP.NET MVC 4.0 By Ram Ayyalaraju co-founder, CTO ShikshaCLUB.com Twitter: @RamAyyalaraju LinkedIn: https://www.linkedin.com/in/ramayyalaraju Website: ShikshaCLUB.com email: ram.ayyalaraju@shikshaclub.com
  • 2. How? • Using PPT • Code Snippets and explanations • Learn By doing - Video library application - Lab sessions - learn by sharing -
  • 3. What is new in ASP.NET MVC 4? • WebAPI • Task Support for Sync controllers • Data Base Migrations – What’s New? • Bundling and Magnifications features – What is new? • More support for mobile development In this Order
  • 4. WebAPI • To Embrace HTTP • Light weight • Scalable (caching) • Interoperable(no plugins and works with any client ) • Flexible (custom model bindings, formatters and filters) • Can pass-through firewalls • routes by http methods like get, post, put, delete verbs
  • 5. Getting Started • Create a WebAPI Project • Create an ASP.NET Project • Create Any Project! Install NuGet Package Install-package Microsoft.Asp.Net.WebApi.SelfHost • Build example project with controllers, views and basic class lib to work
  • 6. Routing • Routes by HTTP methods (Get, Post, Put, Delete) • Other Methods available via [AcceptWorps] • Looks at the start of an action name
  • 7. WebAPI Routing cont... • public class RouteConfig • { • public static void RegisterRoutes(RouteCollection routes) • { • routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); • routes.MapRoute( • name: "Default", • url: "{controller}/{action}/{id}", • defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } • ); • } • }
  • 8. Routing cont… • Response in browser • Response with cURL cmd line util cURL Download url: http://curl.haxx.se/download.html ex: http://localhost:1341/api/videos (controller name) • WebAPI supports multiple Get methods with different signatures, it’s not true with MVC • Put/ Delete examples
  • 9. WebAPI Content Negotiation • Core mechanism of HTTP • Client specifies desired formats using Accept hearder • <<Diagram>>
  • 10. WebAPI Content Negotiation…cont GlobalConfiguration.Configuration.Formatters Count = 4 [0]: {System.Net.Http.Formatting.JsonMediaTypeFormatter} [1]: {System.Net.Http.Formatting.XmlMediaTypeFormatter} [2]: {System.Net.Http.Formatting.FormUrlEncodedMediaTypeF ormatter} [3]: {System.Web.Http.ModelBinding.JQueryMvcFormUrlEncod edFormatter}
  • 11. Action Parameters • How Get, Post, Put, Delete works • Primitive types (assumed not to be in message body) • Complex types (assumed to be in message boday) • Only Single model is allowed from message boday • <<Implementing PUT and POST by example>>
  • 12. Async Awaite in MVC 4.0 • What is Async and Await • Task Parallel Library • Async Controls
  • 13. Asycn Awit Example • <<Example Code walk through >>
  • 14. Async Controler • AsyncControls base class • <<How it’s used in MVC by Example>>

×