SlideShare ist ein Scribd-Unternehmen logo
1 von 19
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

Weitere ähnliche Inhalte

Was ist angesagt?

Tumbleweed intro
Tumbleweed introTumbleweed intro
Tumbleweed introRich Helton
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by GoogleASG
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentationdimuthu22
 
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 ControlsRandy Connolly
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20HUST
 
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 questionsAkhil Mittal
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend FrameworkJuan Antonio
 

Was ist angesagt? (20)

Tumbleweed intro
Tumbleweed introTumbleweed intro
Tumbleweed intro
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
Azure rev002
Azure rev002Azure rev002
Azure rev002
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
CodeIgniter 101 Tutorial
CodeIgniter 101 TutorialCodeIgniter 101 Tutorial
CodeIgniter 101 Tutorial
 
Microsoft Azure
Microsoft AzureMicrosoft Azure
Microsoft Azure
 
Rest web service
Rest web serviceRest web service
Rest web service
 
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...
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
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
 
Oracle ADF 11g Tutorial
Oracle ADF 11g TutorialOracle ADF 11g Tutorial
Oracle ADF 11g Tutorial
 
Mvc4
Mvc4Mvc4
Mvc4
 
Jsf
JsfJsf
Jsf
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
 
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
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend Framework
 

Andere mochten auch

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 DEVELOPMENTDr. 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 2Microsoft
 
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 CoreFilip 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 ControlMaarten 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 FRAMEWORKSpringPeople
 
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 OverviewShahed 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 MVCMohd Manzoor Ahmed
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
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 dungIT Expert Club
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter 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 FundamentalsIdo Flatow
 

Andere mochten auch (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
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
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!
 
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...
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
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
 
Web api
Web apiWeb api
Web api
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
ADO.NET -database connection
ADO.NET -database connectionADO.NET -database connection
ADO.NET -database connection
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
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
 

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

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 FeaturesPeter 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 indiaJignesh 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 applicationAMARAAHMED7
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago 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 0Dima 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 PresentationRasel Khan
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend IntegrationElewayte
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101Rich Helton
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architectureIblesoft
 

Ähnlich wie Web API with ASP.NET MVC by Software development company in india (20)

Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
 
Implementation web api
Implementation web apiImplementation web api
Implementation web api
 
C# web api
C# web apiC# web api
C# web api
 
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
 
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
 
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
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
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
 
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
 
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.
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Web api
Web apiWeb api
Web api
 
Asp
AspAsp
Asp
 
API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
 
Asp dot net long
Asp dot net longAsp dot net long
Asp dot net long
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 

Mehr von iFour Institute - Sustainable Learning

Mehr von 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.
 
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.
 
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. ...
 
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...
 
C# fundamentals Part 2
C# fundamentals Part 2C# fundamentals Part 2
C# fundamentals Part 2
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
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
 

Kürzlich hochgeladen

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Kürzlich hochgeladen (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

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

Hinweis der Redaktion

  1. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  2. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  3. 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/