This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Represents the startup process for the application. | |
/// </summary> | |
public class Startup | |
{ | |
/// <summary> | |
/// Configures services for the application. | |
/// </summary> | |
/// <param name="services">The collection of services to configure the application with.</param> | |
public void ConfigureServices(IServiceCollection services) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Microsoft.Examples | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
using System.Reflection; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.3.0" /> | |
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="2.2.0" /> | |
<PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string]$tenantId = "", | |
[string]$subscriptionId = "", | |
[string]$resourceGroupName = "", | |
[string]$apimServiceName = "", | |
[string]$clientId = "", | |
[string]$clientSecret = "", | |
[string]$apiName = "", | |
[string]$backendUrl = "", | |
[bool] $apiContainsMultipleVersions = $true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddApiVersioning(o => o.ReportApiVersions = true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiVersion("1.0")] | |
[ApiVersion("2.0")] | |
[Route("api/home")] | |
public class HomeController : Controller | |
{ | |
[HttpGet] | |
public string Get() => "Version 1"; | |
[HttpGet, MapToApiVersion("2.0")] | |
public string GetV2() => "Version 2"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger":"2.0", | |
"info":{ | |
"version":"3.0", | |
"title":"Sample API 3.0", | |
"description":"A sample application with Swagger, Swashbuckle, and API versioning." | |
}, | |
"paths":{ | |
"/api/v3/People":{ | |
"get":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo: required | |
dist: trusty | |
language: node_js | |
node_js: | |
- '7.7.4' | |
services: | |
- docker | |
addons: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
import * as nconf from 'nconf'; | |
nconf.argv().env().file({ file: 'config.json' }); | |
import databaseSetup from "../../infrastructure/DatabaseSetup"; | |
import application from "../../application/application"; | |
import { GetIdeasRequest, GetIdeasResponse } from "../../scenarios/GetIdeas"; | |
import { InsertIdeaRequest, InsertIdeaResponse } from "../../scenarios/InsertIdea"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/', catchAsyncErrors(async function (req, res, next) { | |
var request = new GetIdeasRequest(); | |
request.user = req.user; | |
var response = await application.ExecuteAsync<GetIdeasRequest, GetIdeasResponse>(request); | |
res.json(response.ideas); | |
})); |
NewerOlder