Soumettre la recherche
Mettre en ligne
Web api routing
•
1 j'aime
•
1,036 vues
Eyal Vardi
Suivre
Asp.net Web api routing
Lire moins
Lire la suite
Technologie
Business
Signaler
Partager
Signaler
Partager
1 sur 12
Recommandé
C++
C++
VishalMishra313
Let's make a contract: The art of designing a Java API | DevNation Tech Talk
Let's make a contract: The art of designing a Java API | DevNation Tech Talk
Red Hat Developers
NSC #2 - D1 01 - Rolf Rolles - Program synthesis in reverse engineering
NSC #2 - D1 01 - Rolf Rolles - Program synthesis in reverse engineering
NoSuchCon
Introduction to c++
Introduction to c++
somu rajesh
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
Asp.Net Mvc Internals & Extensibility
Asp.Net Mvc Internals & Extensibility
Eyal Vardi
Asp.net web api extensibility
Asp.net web api extensibility
Eyal Vardi
Asp.net mvc internals & extensibility
Asp.net mvc internals & extensibility
Eyal Vardi
Recommandé
C++
C++
VishalMishra313
Let's make a contract: The art of designing a Java API | DevNation Tech Talk
Let's make a contract: The art of designing a Java API | DevNation Tech Talk
Red Hat Developers
NSC #2 - D1 01 - Rolf Rolles - Program synthesis in reverse engineering
NSC #2 - D1 01 - Rolf Rolles - Program synthesis in reverse engineering
NoSuchCon
Introduction to c++
Introduction to c++
somu rajesh
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
Asp.Net Mvc Internals & Extensibility
Asp.Net Mvc Internals & Extensibility
Eyal Vardi
Asp.net web api extensibility
Asp.net web api extensibility
Eyal Vardi
Asp.net mvc internals & extensibility
Asp.net mvc internals & extensibility
Eyal Vardi
OData and SharePoint
OData and SharePoint
Sanjay Patel
Web api crud operations
Web api crud operations
Eyal Vardi
Wcf data services
Wcf data services
Eyal Vardi
Odata introduction
Odata introduction
Ahmad Dwedar
Federico Feroldi - Scala microservices
Federico Feroldi - Scala microservices
Scala Italy
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
Guillaume Laforge
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and Flux
Jirat Kijlerdpornpailoj
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
Kiev ALT.NET
RESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an Introduction
Miredot
Models
Models
Eyal Vardi
Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)
Andrey Volobuev
apidays Paris 2022 - France Televisions : How we leverage API Platform for ou...
apidays Paris 2022 - France Televisions : How we leverage API Platform for ou...
apidays
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Roel Hartman
OpenTox API introductory presentation
OpenTox API introductory presentation
Pantelis Sopasakis
Post Sharp Talk
Post Sharp Talk
willmation
Rack Middleware
Rack Middleware
LittleBIGRuby
Pearson Plug and Play @ Over the Air
Pearson Plug and Play @ Over the Air
Dan Murphy
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
Mark Wilkinson
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
Daniel Spector
STL ALGORITHMS
STL ALGORITHMS
fawzmasood
Why magic
Why magic
Eyal Vardi
Smart Contract
Smart Contract
Eyal Vardi
Contenu connexe
Similaire à Web api routing
OData and SharePoint
OData and SharePoint
Sanjay Patel
Web api crud operations
Web api crud operations
Eyal Vardi
Wcf data services
Wcf data services
Eyal Vardi
Odata introduction
Odata introduction
Ahmad Dwedar
Federico Feroldi - Scala microservices
Federico Feroldi - Scala microservices
Scala Italy
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
Guillaume Laforge
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and Flux
Jirat Kijlerdpornpailoj
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
Kiev ALT.NET
RESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an Introduction
Miredot
Models
Models
Eyal Vardi
Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)
Andrey Volobuev
apidays Paris 2022 - France Televisions : How we leverage API Platform for ou...
apidays Paris 2022 - France Televisions : How we leverage API Platform for ou...
apidays
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Roel Hartman
OpenTox API introductory presentation
OpenTox API introductory presentation
Pantelis Sopasakis
Post Sharp Talk
Post Sharp Talk
willmation
Rack Middleware
Rack Middleware
LittleBIGRuby
Pearson Plug and Play @ Over the Air
Pearson Plug and Play @ Over the Air
Dan Murphy
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
Mark Wilkinson
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
Daniel Spector
STL ALGORITHMS
STL ALGORITHMS
fawzmasood
Similaire à Web api routing
(20)
OData and SharePoint
OData and SharePoint
Web api crud operations
Web api crud operations
Wcf data services
Wcf data services
Odata introduction
Odata introduction
Federico Feroldi - Scala microservices
Federico Feroldi - Scala microservices
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and Flux
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
RESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an Introduction
Models
Models
Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)
apidays Paris 2022 - France Televisions : How we leverage API Platform for ou...
apidays Paris 2022 - France Televisions : How we leverage API Platform for ou...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
OpenTox API introductory presentation
OpenTox API introductory presentation
Post Sharp Talk
Post Sharp Talk
Rack Middleware
Rack Middleware
Pearson Plug and Play @ Over the Air
Pearson Plug and Play @ Over the Air
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
STL ALGORITHMS
STL ALGORITHMS
Plus de Eyal Vardi
Why magic
Why magic
Eyal Vardi
Smart Contract
Smart Contract
Eyal Vardi
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Eyal Vardi
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Eyal Vardi
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Eyal Vardi
Angular 2 NgModule
Angular 2 NgModule
Eyal Vardi
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Eyal Vardi
Routing And Navigation
Routing And Navigation
Eyal Vardi
Angular 2 Architecture
Angular 2 Architecture
Eyal Vardi
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Eyal Vardi
Angular 2.0 Views
Angular 2.0 Views
Eyal Vardi
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Eyal Vardi
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Eyal Vardi
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Eyal Vardi
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Eyal Vardi
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Eyal Vardi
Angular 2.0 Pipes
Angular 2.0 Pipes
Eyal Vardi
Angular 2.0 forms
Angular 2.0 forms
Eyal Vardi
Plus de Eyal Vardi
(20)
Why magic
Why magic
Smart Contract
Smart Contract
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 NgModule
Angular 2 NgModule
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Routing And Navigation
Routing And Navigation
Angular 2 Architecture
Angular 2 Architecture
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Angular 2.0 Views
Angular 2.0 Views
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Angular 2.0 Pipes
Angular 2.0 Pipes
Angular 2.0 forms
Angular 2.0 forms
Dernier
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
apidays
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Christopher Logan Kennedy
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Orbitshub
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
danishmna97
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Deepika Singh
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
rafiqahmad00786416
Architecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Angeliki Cooney
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
The Digital Insurer
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
johnbeverley2021
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Jeffrey Haguewood
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Remote DBA Services
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Zilliz
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Nanddeep Nachan
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
jfdjdjcjdnsjd
Dernier
(20)
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Architecting Cloud Native Applications
Architecting Cloud Native Applications
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Web api routing
1.
Web API Routing
Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog: www.eVardi.com
2.
Expert Days 2012
© 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
3.
Routing Has Three
Main Phases 1. Matching the URI to a route template. 2. Selecting a controller. 3. Selecting an action. © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
4.
Routing Tables
routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } constraints: new { id = @"d+" } ); Action HTTP method Relative URI Get a list of all products GET /api/products Get a product by ID GET /api/products/id Get a product by category GET /api/products?category=1 © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
5.
Action Mapping
public class ProductsController : ApiController { public void GetAllProducts() { } public IEnumerable<Product> GetProductById(int id) { } public HttpResponseMessage DeleteProduct(int id) { } } Method URI Path Action Parameter GET api/products GetAllProducts (none) GET api/products/4 GetProductById 4 DELETE api/products/4 DeleteProduct 4 POST api/products (no match) © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
6.
Routing by Action
Name routes.MapHttpRoute( name: "ActionApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } ); public class ProductsController : ApiController { [AcceptVerbs("GET", "HEAD")] public Product FindProduct(id) { } // WebDAV method [AcceptVerbs("MKCOL")] public void MakeCollection() { } } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
7.
Web API Routing ©
2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
8.
Paging and Querying
(OData) ASP.NET Web API provides built-in support for OData query parameters. $filter, $orderby, $skip & $top Examples /api/products?$filter=substringof(Name, 'Ed') eq true api/products?$skip=2 api/products?$top=3&$orderby=Name [Queryable(ResultLimit=20)] public IQueryable<Product> GetAllProducts() { return repository.GetAll().AsQueryable(); } © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
9.
Query string options
$Expand /Customers(ALFKI)?$expand=Orders.Employees $Orderby /Customers?$orderby=City desc, CompanyName $Skip /Customers?$skip=10 $Top /Orders?$orderby=TotalDue&$top=5 $Filter /Customers?$filter=City eq ‘London’ © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
10.
Expression Syntax
Operator Description Example Logical Operators eq Equal /Customers?filter = City eq 'London' ne Not equal /Customers?filter = City ne 'London' gt Greater than /Product?$filter = UnitPrice gt 20 gteq Greater than or equal /Orders?$filter = Freight gteq 800 lt Less than /Orders?$filter = Freight lt 1 lteq Less than or equal /Product?$filter = UnitPrice lteq 20 and Logical and /Product?filter=UnitPrice lteq 20 and UnitPrice gt 10 or Logical or /Product?filter=UnitPrice lteq 20 or UnitPrice gt 10 not Logical negation /Orders?$ ?$filter=not endswith(ShipPostalCode,'100') Arithmetic Operators add Addition /Product?filter = UnitPrice add 5 gt 10 sub Subtraction /Product?filter = UnitPrice sub 5 gt 10 mul Multiplication /Orders?$filter = Freight mul 800 gt 2000 div Division /Orders?$filter = Freight div 10 eq 4 mod Modulo /Orders?$filter = Freight mod 10 eq 0 Grouping Operators ( ) Precedence grouping /Product?filter = (UnitPrice sub 5) gt 10 © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
11.
Expression Syntax Cont.
String Functions Date Functions bool contains(string p0, string p1) int day(DateTime p0) bool endswith(string p0, string p1) int hour(DateTime p0) bool startswith(string p0, string p1) int minute(DateTime p0) int length(string p0) int month(DateTime p0) int indexof(string arg) int second(DateTime p0) string insert(string p0, int pos, string p1) int year(DateTime p0) string remove(string p0, int pos) string remove(string p0, int pos, int length) string replace(string p0, string find, string replace) Math Functions string substring(string p0, int pos) double round(double p0) string substring(string p0, int pos, int length) decimal round(decimal p0) string tolower(string p0) double floor(double p0) string toupper(string p0) decimal floor(decimal p0) string trim(string p0) double ceiling(double p0) string concat(string p0, string p1) decimal ceiling(decimal p) Type Functions bool IsOf(type p0) bool IsOf(expression p0, type p1) <p0> Cast(type p0) <p1> Cast(expression p0, type p1) © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il
12.
Data Services
URL Syntax © 2010 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il