diff --git a/benchmarkapps/BasicApi/Controllers/PetController.cs b/benchmarkapps/BasicApi/Controllers/PetController.cs index 828b445899..8a30fb18c2 100644 --- a/benchmarkapps/BasicApi/Controllers/PetController.cs +++ b/benchmarkapps/BasicApi/Controllers/PetController.cs @@ -25,6 +25,9 @@ namespace BasicApi.Controllers public BasicApiContext DbContext { get; } [HttpGet("{id}", Name = "FindPetById")] + [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task> FindById(int id) { var pet = await DbContext.Pets @@ -42,6 +45,8 @@ namespace BasicApi.Controllers [AllowAnonymous] [HttpGet("anonymous/{id}")] + [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task> FindByIdWithoutToken(int id) { var pet = await DbContext.Pets @@ -58,6 +63,9 @@ namespace BasicApi.Controllers } [HttpGet("findByCategory/{categoryId}")] + [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task> FindByCategory(int categoryId) { var pet = await DbContext.Pets @@ -74,6 +82,9 @@ namespace BasicApi.Controllers } [HttpGet("findByStatus")] + [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task> FindByStatus(string status) { var pet = await DbContext.Pets @@ -90,6 +101,9 @@ namespace BasicApi.Controllers } [HttpGet("findByTags")] + [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task> FindByTags(string[] tags) { var pet = await DbContext.Pets @@ -107,6 +121,9 @@ namespace BasicApi.Controllers [Authorize("pet-store-writer")] [HttpPost] + [ProducesResponseType(StatusCodes.Status201Created)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] public async Task AddPet([FromBody] Pet pet) { DbContext.Pets.Add(pet); diff --git a/benchmarkapps/BasicApi/Controllers/TokenController.cs b/benchmarkapps/BasicApi/Controllers/TokenController.cs index 624288ddd7..803a1d208e 100644 --- a/benchmarkapps/BasicApi/Controllers/TokenController.cs +++ b/benchmarkapps/BasicApi/Controllers/TokenController.cs @@ -7,6 +7,7 @@ using System.IdentityModel.Tokens.Jwt; using System.Linq; using System.Security.Claims; using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Microsoft.IdentityModel.Tokens; @@ -45,11 +46,13 @@ namespace BasicApi.Controllers } [HttpGet("/token")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] public IActionResult GetToken(string username) { if (username == null || !_identities.TryGetValue(username, out var identity)) { - return new StatusCodeResult(403); + return new StatusCodeResult(StatusCodes.Status403Forbidden); } var handler = _options.SecurityTokenValidators.OfType().First(); diff --git a/benchmarkapps/BasicApi/Startup.cs b/benchmarkapps/BasicApi/Startup.cs index 8fcc4787ae..52fa10105a 100644 --- a/benchmarkapps/BasicApi/Startup.cs +++ b/benchmarkapps/BasicApi/Startup.cs @@ -68,7 +68,7 @@ namespace BasicApi case "MYSQL": services .AddEntityFrameworkMySql() - .AddDbContext(options => options.UseMySql(connectionString)); + .AddDbContextPool(options => options.UseMySql(connectionString)); break; #endif diff --git a/benchmarkapps/BasicViews/Startup.cs b/benchmarkapps/BasicViews/Startup.cs index 30ebb341bd..8d24470a28 100644 --- a/benchmarkapps/BasicViews/Startup.cs +++ b/benchmarkapps/BasicViews/Startup.cs @@ -49,7 +49,7 @@ namespace BasicViews case "MYSQL": services .AddEntityFrameworkMySql() - .AddDbContext(options => options.UseMySql(connectionString)); + .AddDbContextPool(options => options.UseMySql(connectionString)); break; #endif diff --git a/build/dependencies.props b/build/dependencies.props index 78e6a161ca..d443b2338e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -7,15 +7,15 @@ is not otherwise referenced. They avoid unnecessary changes to the Universe build graph or to product dependencies. Do not use these properties elsewhere. --> - + 0.9.9 0.10.13 - 2.1.0 - 2.1.0 - 2.1.0 - 0.42.1 - 2.1.0 - 2.1.0-rc1-final + 2.1.1 + 2.1.1 + 2.1.1 + 0.43.0 + 2.1.1.1 + 2.1.1 2.2.0-preview1-34823 2.2.0-preview1-17102 2.2.0-preview1-34823