SlideShare a Scribd company logo
iFour ConsultancyASP.NET MVC Web API
 ASP.NET Web API
 Why ASP.NET MVC Web API?
 ASP.NET Web API Features
 ASP.NET Web API Design
 ASP.NET MVC Web API
 Routing Table
 Error & Exception Handling
 Model Validation
INDEX
http://www.ifourtechnolab.com/ C# Software Development Companies India
 Framework for building and consuming HTTP services that can reach a broad range of
clients including browsers, phones and tablets
 Use XML or JSON or something else with API. JSON is nice for mobile apps with slow
connections
 For example: Call an API from jQuery and better utilize the client's machine and browser
What is ASP.NET Web API?
http://www.ifourtechnolab.com/ C# Software Development Companies India
 It is built for all the other, non-human interactions website or service needs to support.
Think about jQuery code that's making an Ajax request, or a service interface that supports
a mobile client
 In these cases, the requests are coming from code and expect some kind of structured
data and specific HTTP Status Codes
These two are very complimentary, but different enough that trying to build out HTTP
services using ASP.NET MVC took a lot of work to get right
Why ASP.NET MVC Web API?
http://www.ifourtechnolab.com/ C# Software Development Companies India
 Modern HTTP programming model
 Directly access and manipulate HTTP requests and responses in Web APIs using a new, strongly
typed HTTP object model
 Full support for routes
 Web APIs now support the full set of route capabilities that have always been a part of the Web
stack, including route parameters and constraints
 Additionally, mapping to actions has full support for conventions, so no longer need to apply
attributes such as [HttpPost] to your classes and methods
 Filters
 Web APIs now supports filters, including well-known filters such as the [Authorize] attribute
ASP.NET Web API Features
http://www.ifourtechnolab.com/ C# Software Development Companies India
 Content negotiation
 The client and server can work together to determine the right format for data being returned
from an API
 Provide default support for XML, JSON, and Form URL-encoded formats, and extend this support
by adding your own formatters
 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
 Improved testability of HTTP details
 Rather than setting HTTP details in static context objects, Web API actions can now work with
instances of HttpRequestMessage and HttpResponseMessage
 Generic versions of these objects also exist to work with custom types in addition to the HTTP
types
ASP.NET Web API Features (Cont.)
http://www.ifourtechnolab.com/ C# Software Development Companies India
 Query composition
 By simply returning IQueryable<t>, Web API will support querying via the OData URL
conventions
 Improved Inversion of Control (IoC) via DependencyResolver
 Web API now uses the service locator pattern implemented by MVC’s dependency resolver to
obtain instances for many different facilities
 Code-based configuration
 Web API configuration is accomplished solely through code, leaving config files clean
 Self-host
 Web APIs can be hosted in own process in addition to IIS while still using the full power of routes
and other features of Web API
ASP.NET Web API Features (Cont.)
http://www.ifourtechnolab.com/ C# Software Development Companies India
 The client is whatever consumes the web API (browser, mobile app, and so forth)
 A model is an object that represents the data in application. In this case, the only model is
a to-do item. Models are represented as simple C# classes (POCOs)
 A controller is an object that handles HTTP requests and creates the HTTP response
ASP.NET Web API Design
http://www.ifourtechnolab.com/ C# Software Development Companies India
 MVC : Model -> View -> Controller
 Create a Model
 Create a Controller
ASP.NET MVC Web API
http://www.ifourtechnolab.com/ C# Software Development Companies India
 It is defined, by default, as api/{controller}/{id} where action is defined by an HTTP method
(in global.asax Application_Start method)
Routing Table
HTTP Method URI Path Action Performed
GET /api/products Get All Products
GET /api/products/id Get Product by Id
GET /api/products?category=category Get Products by Category
POST /api/products Insert Product
PUT /api/products/id Update Product
DELETE /api/products/id Delete Product
http://www.ifourtechnolab.com/ C# Software Development Companies India
The four main HTTP methods are mapped to CRUD operations:
 Get retrieves the representation of the resource at a specified URI. GET should have no side
effects on server
 PUT updates a resource at a specified URI
 POST Create a new resource. The server assigns the URI for the new object and returns this URI
as part of the response message
 DELETE deletes a resource at a specified URI
Routing Table
http://www.ifourtechnolab.com/ C# Software Development Companies India
ASP.NET MVC Web API - Example
APIs for crud operation for products
http://www.ifourtechnolab.com/ C# Software Development Companies India
 Response messages, errors and exceptions are translated to HTTP response status codes
 For example:
 POST request should reply with HTTP status 201 (created)
 DELETE request should reply with HTTP status 204 (no content)
 But:
 If a PUT/GET request is done with an invalid id, it should reply with HTTP status 404 (not found)
 Or if a PUT request has invalid model, it can reply with HTTP status 400 (bad request)
Error & Exception Handling
http://www.ifourtechnolab.com/ C# Software Development Companies India
 By default, all .NET exceptions are translated into an HTTP response with status code 500
(internal error)
 It is possible to register Exception filters:
Error & Exception Handling (Cont.)
http://www.ifourtechnolab.com/ C# Software Development Companies India
 Like MVC, Web API supports Data Annotations
(System.ComponentModel.DataAnnotations)
Model Validation
http://www.ifourtechnolab.com/ C# Software Development Companies India
Model Validation - Example
http://www.ifourtechnolab.com/ C# Software Development Companies India
 Create a FilterAttribute
 Add it to Filters in Global.asax Application_Start
Model Validation - FilterAttribute
http://www.ifourtechnolab.com/ C# Software Development Companies India
 https://www.tutorialspoint.com/asp.net_mvc/asp.net_mvc_web_api.htm
 https://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-
your-first-web-api
 http://www.c-sharpcorner.com/uploadfile/4d9083/how-to-create-web-api-in-asp-net-
mvc/
References
http://www.ifourtechnolab.com/ C# Software Development Companies India
Questions?
http://www.ifourtechnolab.com/ C# Software Development Companies India
Ad

More Related Content

What's hot (20)

Tumbleweed intro
Tumbleweed introTumbleweed intro
Tumbleweed intro
Rich Helton
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
ASG
 
Azure rev002
Azure rev002Azure rev002
Azure rev002
Rich Helton
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
dimuthu22
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
Muhammad Hafiz Hasan
 
CodeIgniter 101 Tutorial
CodeIgniter 101 TutorialCodeIgniter 101 Tutorial
CodeIgniter 101 Tutorial
Konstantinos Magarisiotis
 
Microsoft Azure
Microsoft AzureMicrosoft Azure
Microsoft Azure
Dima Maleev
 
Rest web service
Rest web serviceRest web service
Rest web service
Hamid Ghorbani
 
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Akhil Mittal
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
Hamid Ghorbani
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
Sudhakar Sharma
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation Controls
Randy Connolly
 
Oracle ADF 11g Tutorial
Oracle ADF 11g TutorialOracle ADF 11g Tutorial
Oracle ADF 11g Tutorial
Rakesh Gujjarlapudi
 
Mvc4
Mvc4Mvc4
Mvc4
Muhammad Younis
 
Jsf
JsfJsf
Jsf
Shaharyar khan
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
Hamid Ghorbani
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20
HUST
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
Hamid Ghorbani
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
Akhil Mittal
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 
Tumbleweed intro
Tumbleweed introTumbleweed intro
Tumbleweed intro
Rich Helton
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
ASG
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
dimuthu22
 
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Akhil Mittal
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation Controls
Randy Connolly
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20
HUST
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
Akhil Mittal
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 

Viewers also liked (20)

C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
Chalermpon Areepong
 
Integration Tales: Logic & API apps to the rescue!
Integration Tales: Logic & API apps to the rescue!Integration Tales: Logic & API apps to the rescue!
Integration Tales: Logic & API apps to the rescue!
Sandro Pereira
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
Maarten Balliauw
 
ASP.NET MVC 5 et Web API 2
ASP.NET MVC 5 et Web API 2ASP.NET MVC 5 et Web API 2
ASP.NET MVC 5 et Web API 2
Microsoft
 
Building HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET CoreBuilding HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET Core
Filip W
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
Maarten Balliauw
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
iFour Institute - Sustainable Learning
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
 
3-TIER ARCHITECTURE IN ASP.NET MVC
3-TIER ARCHITECTURE IN ASP.NET MVC3-TIER ARCHITECTURE IN ASP.NET MVC
3-TIER ARCHITECTURE IN ASP.NET MVC
Mohd Manzoor Ahmed
 
Excellent rest using asp.net web api
Excellent rest using asp.net web apiExcellent rest using asp.net web api
Excellent rest using asp.net web api
Maurice De Beijer [MVP]
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
Toi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dungToi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dung
IT Expert Club
 
Web api
Web apiWeb api
Web api
Sudhakar Sharma
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin Shah
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
Randy Connolly
 
ADO.NET -database connection
ADO.NET -database connectionADO.NET -database connection
ADO.NET -database connection
Anekwong Yoddumnern
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Peter Gfader
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
Ido Flatow
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
Integration Tales: Logic & API apps to the rescue!
Integration Tales: Logic & API apps to the rescue!Integration Tales: Logic & API apps to the rescue!
Integration Tales: Logic & API apps to the rescue!
Sandro Pereira
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
Maarten Balliauw
 
ASP.NET MVC 5 et Web API 2
ASP.NET MVC 5 et Web API 2ASP.NET MVC 5 et Web API 2
ASP.NET MVC 5 et Web API 2
Microsoft
 
Building HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET CoreBuilding HTTP APIs with ASP.NET Core
Building HTTP APIs with ASP.NET Core
Filip W
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
Maarten Balliauw
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
 
3-TIER ARCHITECTURE IN ASP.NET MVC
3-TIER ARCHITECTURE IN ASP.NET MVC3-TIER ARCHITECTURE IN ASP.NET MVC
3-TIER ARCHITECTURE IN ASP.NET MVC
Mohd Manzoor Ahmed
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
Toi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dungToi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dung
IT Expert Club
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin Shah
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Peter Gfader
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
Ido Flatow
 
Ad

Similar to Web API with ASP.NET MVC by Software development company in india (20)

ASP.NET Web API Interview Questions By Scholarhat
ASP.NET Web API Interview Questions By ScholarhatASP.NET Web API Interview Questions By Scholarhat
ASP.NET Web API Interview Questions By Scholarhat
Scholarhat
 
Basics Of Introduction to ASP.NET Core.pptx
Basics Of Introduction to ASP.NET Core.pptxBasics Of Introduction to ASP.NET Core.pptx
Basics Of Introduction to ASP.NET Core.pptx
1rajeev1mishra
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
Binu Bhasuran
 
Implementation web api
Implementation web apiImplementation web api
Implementation web api
Zeeshan Ahmed Khalil
 
C# web api
C# web apiC# web api
C# web api
Simplilearn
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
Peter Gfader
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company india
Jignesh Aakoliya
 
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web applicationASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web application
AMARAAHMED7
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
Harish Ranganathan
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
MVC by asp.net development company in india
MVC by asp.net development company in indiaMVC by asp.net development company in india
MVC by asp.net development company in india
iFour Institute - Sustainable Learning
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0
Dima Maleev
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
home
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
rsnarayanan
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
Rasel Khan
 
Web api
Web apiWeb api
Web api
udaiappa
 
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdfASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
Scholarhat
 
Asp
AspAsp
Asp
Kundan Kumar Pandey
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
Elewayte
 
ASP.NET Web API Interview Questions By Scholarhat
ASP.NET Web API Interview Questions By ScholarhatASP.NET Web API Interview Questions By Scholarhat
ASP.NET Web API Interview Questions By Scholarhat
Scholarhat
 
Basics Of Introduction to ASP.NET Core.pptx
Basics Of Introduction to ASP.NET Core.pptxBasics Of Introduction to ASP.NET Core.pptx
Basics Of Introduction to ASP.NET Core.pptx
1rajeev1mishra
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
Peter Gfader
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company india
Jignesh Aakoliya
 
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web applicationASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web application
AMARAAHMED7
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0
Dima Maleev
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
home
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
Rasel Khan
 
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdfASP.NET Core Interview Questions PDF By ScholarHat.pdf
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
Scholarhat
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
Elewayte
 
Ad

More from iFour Institute - Sustainable Learning (8)

Project Management : Project Planning by iFour Technolab Pvt. Ltd.
Project Management : Project Planning by iFour Technolab Pvt. Ltd.Project Management : Project Planning by iFour Technolab Pvt. Ltd.
Project Management : Project Planning by iFour Technolab Pvt. Ltd.
iFour Institute - Sustainable Learning
 
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
iFour Institute - Sustainable Learning
 
Project management : Causal analysis and Resolution by iFour Technolab Pvt. ...
Project management :  Causal analysis and Resolution by iFour Technolab Pvt. ...Project management :  Causal analysis and Resolution by iFour Technolab Pvt. ...
Project management : Causal analysis and Resolution by iFour Technolab Pvt. ...
iFour Institute - Sustainable Learning
 
Here are proven techniques to Organizing effective training by iFour Technola...
Here are proven techniques to Organizing effective training by iFour Technola...Here are proven techniques to Organizing effective training by iFour Technola...
Here are proven techniques to Organizing effective training by iFour Technola...
iFour Institute - Sustainable Learning
 
C# fundamentals Part 2
C# fundamentals Part 2C# fundamentals Part 2
C# fundamentals Part 2
iFour Institute - Sustainable Learning
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
iFour Institute - Sustainable Learning
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
iFour Institute - Sustainable Learning
 
HTML Basics by software development company india
HTML Basics by software development company indiaHTML Basics by software development company india
HTML Basics by software development company india
iFour Institute - Sustainable Learning
 

Recently uploaded (20)

Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 

Web API with ASP.NET MVC by Software development company in india

  • 2.  ASP.NET Web API  Why ASP.NET MVC Web API?  ASP.NET Web API Features  ASP.NET Web API Design  ASP.NET MVC Web API  Routing Table  Error & Exception Handling  Model Validation INDEX http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 3.  Framework for building and consuming HTTP services that can reach a broad range of clients including browsers, phones and tablets  Use XML or JSON or something else with API. JSON is nice for mobile apps with slow connections  For example: Call an API from jQuery and better utilize the client's machine and browser What is ASP.NET Web API? http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 4.  It is built for all the other, non-human interactions website or service needs to support. Think about jQuery code that's making an Ajax request, or a service interface that supports a mobile client  In these cases, the requests are coming from code and expect some kind of structured data and specific HTTP Status Codes These two are very complimentary, but different enough that trying to build out HTTP services using ASP.NET MVC took a lot of work to get right Why ASP.NET MVC Web API? http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 5.  Modern HTTP programming model  Directly access and manipulate HTTP requests and responses in Web APIs using a new, strongly typed HTTP object model  Full support for routes  Web APIs now support the full set of route capabilities that have always been a part of the Web stack, including route parameters and constraints  Additionally, mapping to actions has full support for conventions, so no longer need to apply attributes such as [HttpPost] to your classes and methods  Filters  Web APIs now supports filters, including well-known filters such as the [Authorize] attribute ASP.NET Web API Features http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 6.  Content negotiation  The client and server can work together to determine the right format for data being returned from an API  Provide default support for XML, JSON, and Form URL-encoded formats, and extend this support by adding your own formatters  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  Improved testability of HTTP details  Rather than setting HTTP details in static context objects, Web API actions can now work with instances of HttpRequestMessage and HttpResponseMessage  Generic versions of these objects also exist to work with custom types in addition to the HTTP types ASP.NET Web API Features (Cont.) http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 7.  Query composition  By simply returning IQueryable<t>, Web API will support querying via the OData URL conventions  Improved Inversion of Control (IoC) via DependencyResolver  Web API now uses the service locator pattern implemented by MVC’s dependency resolver to obtain instances for many different facilities  Code-based configuration  Web API configuration is accomplished solely through code, leaving config files clean  Self-host  Web APIs can be hosted in own process in addition to IIS while still using the full power of routes and other features of Web API ASP.NET Web API Features (Cont.) http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 8.  The client is whatever consumes the web API (browser, mobile app, and so forth)  A model is an object that represents the data in application. In this case, the only model is a to-do item. Models are represented as simple C# classes (POCOs)  A controller is an object that handles HTTP requests and creates the HTTP response ASP.NET Web API Design http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 9.  MVC : Model -> View -> Controller  Create a Model  Create a Controller ASP.NET MVC Web API http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 10.  It is defined, by default, as api/{controller}/{id} where action is defined by an HTTP method (in global.asax Application_Start method) Routing Table HTTP Method URI Path Action Performed GET /api/products Get All Products GET /api/products/id Get Product by Id GET /api/products?category=category Get Products by Category POST /api/products Insert Product PUT /api/products/id Update Product DELETE /api/products/id Delete Product http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 11. The four main HTTP methods are mapped to CRUD operations:  Get retrieves the representation of the resource at a specified URI. GET should have no side effects on server  PUT updates a resource at a specified URI  POST Create a new resource. The server assigns the URI for the new object and returns this URI as part of the response message  DELETE deletes a resource at a specified URI Routing Table http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 12. ASP.NET MVC Web API - Example APIs for crud operation for products http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 13.  Response messages, errors and exceptions are translated to HTTP response status codes  For example:  POST request should reply with HTTP status 201 (created)  DELETE request should reply with HTTP status 204 (no content)  But:  If a PUT/GET request is done with an invalid id, it should reply with HTTP status 404 (not found)  Or if a PUT request has invalid model, it can reply with HTTP status 400 (bad request) Error & Exception Handling http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 14.  By default, all .NET exceptions are translated into an HTTP response with status code 500 (internal error)  It is possible to register Exception filters: Error & Exception Handling (Cont.) http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 15.  Like MVC, Web API supports Data Annotations (System.ComponentModel.DataAnnotations) Model Validation http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 16. Model Validation - Example http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 17.  Create a FilterAttribute  Add it to Filters in Global.asax Application_Start Model Validation - FilterAttribute http://www.ifourtechnolab.com/ C# Software Development Companies India
  • 18.  https://www.tutorialspoint.com/asp.net_mvc/asp.net_mvc_web_api.htm  https://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial- your-first-web-api  http://www.c-sharpcorner.com/uploadfile/4d9083/how-to-create-web-api-in-asp-net- mvc/ References http://www.ifourtechnolab.com/ C# Software Development Companies India

Editor's Notes

  • #2: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #4: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #5: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #6: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #7: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #8: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #9: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #10: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #11: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #12: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #13: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #14: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #15: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #16: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #17: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #18: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #19: Software Outsourcing Company India - http://www.ifourtechnolab.com/
  • #20: Software Outsourcing Company India - http://www.ifourtechnolab.com/