Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
###
# AdvancedODataWebApiExample - ASP.NET OData Web API Advanced Versioning
# This example demonstrates advanced OData scenarios with multiple versioning strategies for legacy ASP.NET Web API
###

@baseUrl = http://localhost:52667

### People - Get All (Default Version)
# Get all people (defaults to latest version when AssumeDefaultVersionWhenUnspecified is enabled)
GET {{baseUrl}}/api/people

### People - Get All - Version 1.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=1.0

### People - Get All with $select - Version 1.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=1.0&$select=FirstName,LastName

### People - Get All with $filter - Version 1.0
# Get filtered people
GET {{baseUrl}}/api/people?api-version=1.0&$filter=Id eq 1

### People - Get by Key - Version 1.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=1.0

### People - Get All - Version 2.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=2.0

### People - Get All with $select - Version 2.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=2.0&$select=FirstName,LastName,Email

### People - Get by Key - Version 2.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=2.0

### People (V2) - Get All - Version 2.0
# Get all people from version 2 specific controller
GET {{baseUrl}}/api/people2?api-version=2.0

### People (V2) - Get by Key - Version 2.0
# Get a specific person by ID from version 2 controller
GET {{baseUrl}}/api/people2/1?api-version=2.0

### Orders - Get All - Version 1.0
# Get all orders
GET {{baseUrl}}/api/v1/orders

### Orders - Get All with $select - Version 1.0
# Get orders with specific fields
GET {{baseUrl}}/api/v1/orders?$select=Id,Customer

### Orders - Get by Key - Version 1.0
# Get a specific order by ID
GET {{baseUrl}}/api/v1/orders/1

### Orders - Get All - Version 2.0
# Get all orders for version 2.0
GET {{baseUrl}}/api/v2/orders

### Orders - Get by Key - Version 2.0
# Get a specific order by ID for version 2.0
GET {{baseUrl}}/api/v2/orders/1

### Orders - Get All - Version 3.0
# Get all orders for version 3.0
GET {{baseUrl}}/api/v3/orders

### Orders - Get by Key - Version 3.0
# Get a specific order by ID for version 3.0
GET {{baseUrl}}/api/v3/orders/1

### Orders - Get All with $expand - Version 3.0
# Get orders with expanded customer details
GET {{baseUrl}}/api/v3/orders?$expand=customer
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
###
# BasicODataWebApiExample - ASP.NET OData Web API with Versioning
# This example demonstrates basic OData endpoints with API versioning for legacy ASP.NET Web API
###

@baseUrl = http://localhost:52667

### People - Get All - Version 1.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=1.0

### People - Get All with $select - Version 1.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=1.0&$select=FirstName,LastName

### People - Get All with $filter - Version 1.0
# Get filtered people
GET {{baseUrl}}/api/people?api-version=1.0&$filter=Id eq 1

### People - Get by Key - Version 1.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=1.0

### People - Get All - Version 2.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=2.0

### People - Get All with $select - Version 2.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=2.0&$select=FirstName,LastName,Email

### People - Get by Key - Version 2.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=2.0

### Orders - Get All - Version 1.0
# Get all orders
GET {{baseUrl}}/api/v1/orders

### Orders - Get All with $select - Version 1.0
# Get orders with specific fields
GET {{baseUrl}}/api/v1/orders?$select=Id,Customer

### Orders - Get by Key - Version 1.0
# Get a specific order by ID
GET {{baseUrl}}/api/v1/orders/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
###
# ConventionsODataWebApiExample - ASP.NET OData Web API with Convention-based Versioning
# This example demonstrates OData endpoints configured using conventions for legacy ASP.NET Web API
###

@baseUrl = http://localhost:52667

### People - Get All - Version 1.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=1.0

### People - Get All with $select - Version 1.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=1.0&$select=FirstName,LastName

### People - Get All with $filter - Version 1.0
# Get filtered people
GET {{baseUrl}}/api/people?api-version=1.0&$filter=Id eq 1

### People - Get by Key - Version 1.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=1.0

### People - Get All - Version 2.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=2.0

### People - Get All with $select - Version 2.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=2.0&$select=FirstName,LastName,Email

### People - Get by Key - Version 2.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=2.0

### Orders - Get All - Version 1.0
# Get all orders
GET {{baseUrl}}/api/v1/orders

### Orders - Get All with $select - Version 1.0
# Get orders with specific fields
GET {{baseUrl}}/api/v1/orders?$select=Id,Customer

### Orders - Get by Key - Version 1.0
# Get a specific order by ID
GET {{baseUrl}}/api/v1/orders/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
###
# OpenApiODataWebApiExample - ASP.NET OData Web API with OpenAPI/Swagger
# This example demonstrates comprehensive OData endpoints with Swagger documentation for legacy ASP.NET Web API
###

@baseUrl = http://localhost:52667

### Orders - Get by Key - Version 0.9 (Deprecated)
# Get a specific order (deprecated version)
GET {{baseUrl}}/api/orders/1?api-version=0.9

### Orders - Get by Key - Version 1.0
# Get a specific order with $select option
GET {{baseUrl}}/api/orders/1?api-version=1.0

### Orders - Get by Key with $select - Version 1.0
# Get a specific order with selected fields
GET {{baseUrl}}/api/orders/1?api-version=1.0&$select=Id,Customer

### People - Get by Key - Version 1.0
# Get a specific person
GET {{baseUrl}}/api/people/1?api-version=1.0

### Orders - Get All - Version 2.0
# Get all orders
GET {{baseUrl}}/api/orders?api-version=2.0

### Orders - Get All with $select - Version 2.0
# Get orders with specific fields
GET {{baseUrl}}/api/orders?api-version=2.0&$select=Id,Customer

### Orders - Get by Key - Version 2.0
# Get a specific order
GET {{baseUrl}}/api/orders/1?api-version=2.0

### People - Get All - Version 2.0
# Get all people
GET {{baseUrl}}/api/people?api-version=2.0

### People - Get All with $select - Version 2.0
# Get people with specific fields
GET {{baseUrl}}/api/people?api-version=2.0&$select=FirstName,LastName,Email

### People - Get by Key - Version 2.0
# Get a specific person with email
GET {{baseUrl}}/api/people/1?api-version=2.0

### Orders - Get All - Version 3.0
# Get all orders
GET {{baseUrl}}/api/orders?api-version=3.0

### Orders - Get All with $filter - Version 3.0
# Get filtered orders
GET {{baseUrl}}/api/orders?api-version=3.0&$filter=Id gt 1

### Orders - Get by Key - Version 3.0
# Get a specific order
GET {{baseUrl}}/api/orders/1?api-version=3.0

### People - Get All - Version 3.0
# Get all people with phone numbers
GET {{baseUrl}}/api/people?api-version=3.0

### People - Get by Key - Version 3.0
# Get a specific person with phone number
GET {{baseUrl}}/api/people/1?api-version=3.0

### Products - Get All - Version 3.0
# Get all products
GET {{baseUrl}}/api/products?api-version=3.0

### Products - Get by Key - Version 3.0
# Get a specific product
GET {{baseUrl}}/api/products/1?api-version=3.0

### Suppliers - Get All - Version 3.0
# Get all suppliers
GET {{baseUrl}}/api/suppliers?api-version=3.0

### Suppliers - Get by Key - Version 3.0
# Get a specific supplier
GET {{baseUrl}}/api/suppliers/1?api-version=3.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
###
# SomeOpenApiODataWebApiExample - ASP.NET OData Web API with Minimal OpenAPI
# This example demonstrates a simple OData controller with OpenAPI support for legacy ASP.NET Web API
###

@baseUrl = http://localhost:52667

### Books - Get All - Version 1.0
# Get all books
GET {{baseUrl}}/api/books?api-version=1.0

### Books - Get All with $select - Version 1.0
# Get books with specific fields
GET {{baseUrl}}/api/books?api-version=1.0&$select=Title,Author

### Books - Get All with $filter - Version 1.0
# Get filtered books by author
GET {{baseUrl}}/api/books?api-version=1.0&$filter=Author eq 'Leo Tolstoy'

### Books - Get All with $orderby - Version 1.0
# Get books ordered by publication year
GET {{baseUrl}}/api/books?api-version=1.0&$orderby=Published desc

### Books - Get All with $top - Version 1.0
# Get top 3 books
GET {{baseUrl}}/api/books?api-version=1.0&$top=3

### Books - Get by ID - Version 1.0
# Get a specific book by ISBN
GET {{baseUrl}}/api/books/9781847490599?api-version=1.0

### Books - Get by ID with $select - Version 1.0
# Get a specific book with selected fields
GET {{baseUrl}}/api/books/9781847490599?api-version=1.0&$select=Title,Published
22 changes: 22 additions & 0 deletions examples/AspNet/WebApi/BasicWebApiExample/BasicWebApiExample.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
###
# BasicWebApiExample - ASP.NET Web API Versioning Examples
# This file demonstrates basic API versioning scenarios for legacy ASP.NET Web API
###

@baseUrl = http://localhost:52667

### ValuesController - Version 1.0
# Get values using query string versioning
GET {{baseUrl}}/api/values?api-version=1.0

### ValuesController - Version 2.0
# Get values using query string versioning
GET {{baseUrl}}/api/values?api-version=2.0

### HelloWorldController - Version 1.0
# Get hello world with URL segment versioning
GET {{baseUrl}}/api/v1.0/helloworld

### HelloWorldController - Get by ID - Version 1.0
# Get hello world with specific ID
GET {{baseUrl}}/api/v1.0/helloworld/42
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
###
# ByNamespaceWebApiExample - ASP.NET Web API Versioning by Namespace
# This example demonstrates organizing API versions by namespace for legacy ASP.NET Web API
###

@baseUrl = http://localhost:52667

### OrdersController - Version 1.0 (URL segment)
# Get orders for an account using URL segment versioning
GET {{baseUrl}}/v1/orders/account123

### OrdersController - Version 1.0 (Query string)
# Get orders for an account using query string versioning
GET {{baseUrl}}/orders/account123?api-version=1.0

### AgreementsController - Version 1.0 (URL segment)
# Get agreement for an account using URL segment versioning
GET {{baseUrl}}/v1/agreements/account123

### AgreementsController - Version 1.0 (Query string)
# Get agreement for an account using query string versioning
GET {{baseUrl}}/agreements/account123?api-version=1.0

### OrdersController - Version 2.0 (URL segment)
# Get orders for an account using URL segment versioning
GET {{baseUrl}}/v2/orders/account456

### OrdersController - Version 2.0 (Query string)
# Get orders for an account using query string versioning
GET {{baseUrl}}/orders/account456?api-version=2.0

### AgreementsController - Version 2.0 (URL segment)
# Get agreement for an account using URL segment versioning
GET {{baseUrl}}/v2/agreements/account456

### AgreementsController - Version 2.0 (Query string)
# Get agreement for an account using query string versioning
GET {{baseUrl}}/agreements/account456?api-version=2.0

### OrdersController - Version 3.0 (URL segment)
# Get orders for an account using URL segment versioning
GET {{baseUrl}}/v3/orders/account789

### OrdersController - Version 3.0 (Query string)
# Get orders for an account using query string versioning
GET {{baseUrl}}/orders/account789?api-version=3.0

### AgreementsController - Version 3.0 (URL segment)
# Get agreement for an account using URL segment versioning
GET {{baseUrl}}/v3/agreements/account789

### AgreementsController - Version 3.0 (Query string)
# Get agreement for an account using query string versioning
GET {{baseUrl}}/agreements/account789?api-version=3.0
Loading