Download presentation
Presentation is loading. Please wait.
Published byGabriella Lyons Modified over 9 years ago
1
Getting Started with the ASP.NET Web API Dhananjay Kumar Infragistics Consultant Microsoft MVP http://debugmode.net http://debugmode.net
2
Some Goodies Two active participants among you may win this cool goodies. We will announce winner name in webinar recap blog post which will be published on Infragistics blog Recording of the webinar with all resources will be available on webinar recap blog post We will ask you for your mailing address and courier you the goodies in India
3
Host : Dhananjay Kumar Infragistics Consultant 6 times Microsoft MVP @debug_mode Blog : http://debugmode.net http://debugmode.net Email : debugmode@outlook.comdebugmode@outlook.com
4
Agenda About Web API Write First Web API using Scaffolding Consuming Web API in jQuery Enabling CORS Code First and Repository Pattern in Web API
5
What is ASP.NET Web API Framework to create HTTP based services Web API can be consumed by wide range of clients from browsers to mobile apps Web API returns data based on the client request It supports convention- based CRUD Actions since it works with HTTP verbs GET,POST,PUT and DELETE.
6
What is ASP.NET Web API Web API Browsers Mobile apps Desktop apps IOT
7
ASP.NET Web API To create HTTP based service HTTP protocol used as the application protocol Responses have an Accept header and HTTP status code. It works on the content negotiation from the clients. So it may return JSON or XML based on the headed of client request. Web API can create or send in the response contents like PDF, Images etc. It has inbuilt ODATA support. So if action has return type Iqueryable, client can apply ODATA query on that. It can hosted in IIS or self hosted
8
ASP.NET Web API Content Negotiation Content negotiation is the process of selecting the best representation for a given response when there are multiple representations available The underling Web API framework implements the content negotiation By default it Web API returns the JSON data While requesting for a resource client can specify the media type. Web API returns the data on the basis of the media types requested by the clients.
9
ASP.NET Web API Demo : End to end Web API using the Scaffolding Set up the database Create model using the Entity framework Database first approach Create Web API using the Scaffolding Consume Web API in the browser to test content negotiation Consume Web API in the jQuery based web application
10
ASP.NET Web API Demo : Solving CORS in Web API Enabling CORS at Controller level Enabling CORS at whole API level Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.
11
ASP.NET Web API Demo : End to end Web API using the Code First and Repository pattern Create the entity class Create the DataContext classed Create repository classes and interfaces Create the Web API using the Repository Consume Web API in the jQuery based web application
12
Summary About Web API Write First Web API using Scaffolding Consuming Web API in jQuery Enabling CORS Code First and Repository Pattern in Web API Creating Charts consuming Web API
13
What Infragistics can offer you? We welcome all of you to take advantage of a FREE 30 Day Trial by downloading the product at: http://www.infragistics.com/products/ultimate/downloadhttp://www.infragistics.com/products/ultimate/download Please reach out to us at Sales-India@infragistics.com for any follow up questions you may have. We welcome the opportunity to assist you.Sales-India@infragistics.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.