From 0a3cfbb4a08b35f636cdae2d47d78e7086d06219 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Wed, 14 Oct 2020 17:43:39 +0200 Subject: [PATCH 01/15] continue migration to net5 --- .github/workflows/cd.yml | 2 +- .github/workflows/ci_all_branches.yml | 2 +- .github/workflows/ci_master.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/preview.yml | 2 +- Directory.Build.targets | 92 +- NuGet.config | 1 - build/dependencies.props | 7 +- demos/WebApp/WebApp.csproj | 2 +- global.json | 2 +- install-sdk.ps1 | 2 +- install-sdk.sh | 2 +- ...ngStarted.AspNetCore.ClientEndpoint.csproj | 2 +- ...tarted.AspNetCore.EvaluationSession.csproj | 2 +- .../GettingStarted.AspNetCore.Intro.csproj | 2 +- ...tingStarted.AspNetCore.IntroOptions.csproj | 2 +- ....AspNetCore.Mvc.ApplicationInsights.csproj | 2 +- ...ingStarted.AspNetCore.Mvc.HttpStore.csproj | 2 +- .../GettingStarted.AspNetCore.Mvc.csproj | 2 +- .../GettingStarted.AspNetCore.Toggles.csproj | 2 +- ...ngStarted.Blazor.WebAssembly.Shared.csproj | 2 +- ...ngStarted.Blazor.WebAssembly.Client.csproj | 2 +- ...ngStarted.Blazor.WebAssembly.Server.csproj | 2 +- .../GettingStarted.ConsoleApp.csproj | 2 +- .../GettingStarted.Worker.csproj | 2 +- ...NetCore.ApplicationInsightProcessor.csproj | 2 +- .../Esquio.AspNetCore.csproj | 2 +- .../Esquio.Blazor.WebAssembly.csproj | 2 +- .../Esquio.Configuration.Store.csproj | 2 +- .../Esquio.Http.Store.csproj | 2 +- .../Esquio.UI.Api.Shared.csproj | 4 +- src/Esquio.UI.Api/Esquio.UI.Api.csproj | 6 +- .../EditContextFluentValidationExtensions.cs | 8 +- src/Esquio.UI.Client/Esquio.UI.Client.csproj | 4 +- src/Esquio.UI.Client/Pages/Products.razor | 2 +- src/Esquio.UI.Host/Esquio.UI.Host.csproj | 4 +- src/Esquio.UI.Host/appsettings.json | 2 +- src/Esquio/Esquio.csproj | 4 +- tests/FunctionalTests/FunctionalTests.csproj | 2 +- tests/UnitTests/UnitTests.csproj | 2 +- tools/Esquio.CliTool/Esquio.CliTool.csproj | 2 +- tools/Esquio.CliTool/Internal/EsquioClient.cs | 1309 +++++++++++------ .../Esquio.MiniProfiler.csproj | 2 +- 43 files changed, 925 insertions(+), 580 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8f660ade..e1ca9471 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.401 + dotnet-version: 5.0.100-rc.2.20479.15 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/ci_all_branches.yml b/.github/workflows/ci_all_branches.yml index 454fe327..d1f2bc9f 100644 --- a/.github/workflows/ci_all_branches.yml +++ b/.github/workflows/ci_all_branches.yml @@ -33,7 +33,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.401 + dotnet-version: 5.0.100-rc.2.20479.15 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index 37ab9a06..c23c3001 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -39,7 +39,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.401 + dotnet-version: 5.0.100-rc.2.20479.15 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 33a2874d..6ad12e4d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.401 + dotnet-version: 5.0.100-rc.2.20479.15 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 4799310e..ee8a3c49 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -37,7 +37,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.401 + dotnet-version: 5.0.100-rc.2.20479.15 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/Directory.Build.targets b/Directory.Build.targets index 52610d27..a83dd501 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -9,64 +9,64 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - - - - - + + + + + - - + + - - + + - - + + \ No newline at end of file diff --git a/NuGet.config b/NuGet.config index 39ea5347..43593dd8 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,6 @@ - \ No newline at end of file diff --git a/build/dependencies.props b/build/dependencies.props index 2902fed4..cadffd5b 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,10 +1,7 @@ - netstandard2.1 - netstandard2.0 - netcoreapp3.1 - netstandard2.0;netstandard2.1 - 16.6.1 + net5.0 + 16.8.0-preview-20200921-01 3.0 preview 1.0.0 diff --git a/demos/WebApp/WebApp.csproj b/demos/WebApp/WebApp.csproj index b919abba..62b495ae 100644 --- a/demos/WebApp/WebApp.csproj +++ b/demos/WebApp/WebApp.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) true preview c04b3d87-8463-4ad4-a4e5-176d01da450d diff --git a/global.json b/global.json index 5fc94178..bb17fc04 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "projects": [ "src", "tests", "samples"], "sdk": { - "version": "3.1.401" + "version": "5.0.100-rc.2.20479.15" } } \ No newline at end of file diff --git a/install-sdk.ps1 b/install-sdk.ps1 index 2cdca5af..9c429509 100644 --- a/install-sdk.ps1 +++ b/install-sdk.ps1 @@ -1,2 +1,2 @@ -$SdkVersion = "3.1.401" +$SdkVersion = "5.0.100-rc.2.20479.15" & "./dotnet-install.ps1" -Version $SdkVersion \ No newline at end of file diff --git a/install-sdk.sh b/install-sdk.sh index 12696c3a..4a189bdc 100644 --- a/install-sdk.sh +++ b/install-sdk.sh @@ -1,5 +1,5 @@ #!/bin/bash -SdkVersion="3.1.401" +SdkVersion="5.0.100-rc.2.20479.15" ./dotnet-install.sh -Version $SdkVersion export PATH="$PATH:$HOME/.dotnet" diff --git a/samples/GettingStarted.AspNetCore.ClientEndpoint/GettingStarted.AspNetCore.ClientEndpoint.csproj b/samples/GettingStarted.AspNetCore.ClientEndpoint/GettingStarted.AspNetCore.ClientEndpoint.csproj index c7cd6497..2297642d 100644 --- a/samples/GettingStarted.AspNetCore.ClientEndpoint/GettingStarted.AspNetCore.ClientEndpoint.csproj +++ b/samples/GettingStarted.AspNetCore.ClientEndpoint/GettingStarted.AspNetCore.ClientEndpoint.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.AspNetCore.EvaluationSession/GettingStarted.AspNetCore.EvaluationSession.csproj b/samples/GettingStarted.AspNetCore.EvaluationSession/GettingStarted.AspNetCore.EvaluationSession.csproj index e1474321..199e0ce9 100644 --- a/samples/GettingStarted.AspNetCore.EvaluationSession/GettingStarted.AspNetCore.EvaluationSession.csproj +++ b/samples/GettingStarted.AspNetCore.EvaluationSession/GettingStarted.AspNetCore.EvaluationSession.csproj @@ -1,7 +1,7 @@ - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.AspNetCore.Intro/GettingStarted.AspNetCore.Intro.csproj b/samples/GettingStarted.AspNetCore.Intro/GettingStarted.AspNetCore.Intro.csproj index c7cd6497..2297642d 100644 --- a/samples/GettingStarted.AspNetCore.Intro/GettingStarted.AspNetCore.Intro.csproj +++ b/samples/GettingStarted.AspNetCore.Intro/GettingStarted.AspNetCore.Intro.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.AspNetCore.IntroOptions/GettingStarted.AspNetCore.IntroOptions.csproj b/samples/GettingStarted.AspNetCore.IntroOptions/GettingStarted.AspNetCore.IntroOptions.csproj index ee88c532..5f18a4a1 100644 --- a/samples/GettingStarted.AspNetCore.IntroOptions/GettingStarted.AspNetCore.IntroOptions.csproj +++ b/samples/GettingStarted.AspNetCore.IntroOptions/GettingStarted.AspNetCore.IntroOptions.csproj @@ -1,7 +1,7 @@ - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.AspNetCore.Mvc.ApplicationInsights/GettingStarted.AspNetCore.Mvc.ApplicationInsights.csproj b/samples/GettingStarted.AspNetCore.Mvc.ApplicationInsights/GettingStarted.AspNetCore.Mvc.ApplicationInsights.csproj index ae1a6dfa..fae1ec53 100644 --- a/samples/GettingStarted.AspNetCore.Mvc.ApplicationInsights/GettingStarted.AspNetCore.Mvc.ApplicationInsights.csproj +++ b/samples/GettingStarted.AspNetCore.Mvc.ApplicationInsights/GettingStarted.AspNetCore.Mvc.ApplicationInsights.csproj @@ -1,7 +1,7 @@ - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.AspNetCore.Mvc.HttpStore/GettingStarted.AspNetCore.Mvc.HttpStore.csproj b/samples/GettingStarted.AspNetCore.Mvc.HttpStore/GettingStarted.AspNetCore.Mvc.HttpStore.csproj index fc0b7122..c97e8d23 100644 --- a/samples/GettingStarted.AspNetCore.Mvc.HttpStore/GettingStarted.AspNetCore.Mvc.HttpStore.csproj +++ b/samples/GettingStarted.AspNetCore.Mvc.HttpStore/GettingStarted.AspNetCore.Mvc.HttpStore.csproj @@ -1,7 +1,7 @@ - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.AspNetCore.Mvc/GettingStarted.AspNetCore.Mvc.csproj b/samples/GettingStarted.AspNetCore.Mvc/GettingStarted.AspNetCore.Mvc.csproj index e1474321..199e0ce9 100644 --- a/samples/GettingStarted.AspNetCore.Mvc/GettingStarted.AspNetCore.Mvc.csproj +++ b/samples/GettingStarted.AspNetCore.Mvc/GettingStarted.AspNetCore.Mvc.csproj @@ -1,7 +1,7 @@ - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.AspNetCore.Toggles/GettingStarted.AspNetCore.Toggles.csproj b/samples/GettingStarted.AspNetCore.Toggles/GettingStarted.AspNetCore.Toggles.csproj index adf2a709..27047a36 100644 --- a/samples/GettingStarted.AspNetCore.Toggles/GettingStarted.AspNetCore.Toggles.csproj +++ b/samples/GettingStarted.AspNetCore.Toggles/GettingStarted.AspNetCore.Toggles.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.Blazor.WebAssembly.Shared/GettingStarted.Blazor.WebAssembly.Shared.csproj b/samples/GettingStarted.Blazor.WebAssembly.Shared/GettingStarted.Blazor.WebAssembly.Shared.csproj index 90a5b7f3..6894d059 100644 --- a/samples/GettingStarted.Blazor.WebAssembly.Shared/GettingStarted.Blazor.WebAssembly.Shared.csproj +++ b/samples/GettingStarted.Blazor.WebAssembly.Shared/GettingStarted.Blazor.WebAssembly.Shared.csproj @@ -1,7 +1,7 @@ - $(NetStandardTargetVersion21) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj b/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj index 548fa40f..89144ece 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj @@ -1,7 +1,7 @@  - $(NetStandardTargetVersion21) + $(NetFrameworkVersion) $(RazorLangVersion) diff --git a/samples/GettingStarted.Blazor.WebAssembly/Server/GettingStarted.Blazor.WebAssembly.Server.csproj b/samples/GettingStarted.Blazor.WebAssembly/Server/GettingStarted.Blazor.WebAssembly.Server.csproj index acbe000a..003f5292 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Server/GettingStarted.Blazor.WebAssembly.Server.csproj +++ b/samples/GettingStarted.Blazor.WebAssembly/Server/GettingStarted.Blazor.WebAssembly.Server.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.ConsoleApp/GettingStarted.ConsoleApp.csproj b/samples/GettingStarted.ConsoleApp/GettingStarted.ConsoleApp.csproj index 12bb9e38..d9cbee85 100644 --- a/samples/GettingStarted.ConsoleApp/GettingStarted.ConsoleApp.csproj +++ b/samples/GettingStarted.ConsoleApp/GettingStarted.ConsoleApp.csproj @@ -2,7 +2,7 @@ Exe - $(NetCoreTargetVersion) + $(NetFrameworkVersion) diff --git a/samples/GettingStarted.Worker/GettingStarted.Worker.csproj b/samples/GettingStarted.Worker/GettingStarted.Worker.csproj index a25774c1..db27e991 100644 --- a/samples/GettingStarted.Worker/GettingStarted.Worker.csproj +++ b/samples/GettingStarted.Worker/GettingStarted.Worker.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) dotnet-Worker-356F47A7-23C2-4B3D-B740-C1B5340C732C diff --git a/src/Esquio.AspNetCore.ApplicationInsightProcessor/Esquio.AspNetCore.ApplicationInsightProcessor.csproj b/src/Esquio.AspNetCore.ApplicationInsightProcessor/Esquio.AspNetCore.ApplicationInsightProcessor.csproj index 6a7b5582..076a28c0 100644 --- a/src/Esquio.AspNetCore.ApplicationInsightProcessor/Esquio.AspNetCore.ApplicationInsightProcessor.csproj +++ b/src/Esquio.AspNetCore.ApplicationInsightProcessor/Esquio.AspNetCore.ApplicationInsightProcessor.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) Esquio feature state processor for Application Insight. For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore;Application Insight $(esquioaspnetcoreapplicationinsightsprocessor) diff --git a/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj b/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj index ac007491..eca946ae 100644 --- a/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj +++ b/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj @@ -1,6 +1,6 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) Feature Toogles Library for ASP.NET Core.For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore $(esquioaspnetcore) diff --git a/src/Esquio.Blazor.WebAssembly/Esquio.Blazor.WebAssembly.csproj b/src/Esquio.Blazor.WebAssembly/Esquio.Blazor.WebAssembly.csproj index a9d2ae53..ed4b1490 100644 --- a/src/Esquio.Blazor.WebAssembly/Esquio.Blazor.WebAssembly.csproj +++ b/src/Esquio.Blazor.WebAssembly/Esquio.Blazor.WebAssembly.csproj @@ -1,7 +1,7 @@  - $(NetStandardTargetVersion21) + $(NetFrameworkVersion) $(RazorLangVersion) Esquio.Blazor.WebAssembly Esquio components and services for Blazor Wasm.For more information see http://github.com/Xabaril/Esquio diff --git a/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj b/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj index f42f4697..24bac037 100644 --- a/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj +++ b/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj @@ -1,7 +1,7 @@  - $(NetStandardMultiTarget) + $(NetFrameworkVersion) Configuration store support for Esquio. For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore;Configuration $(esquioconfigurationstore) diff --git a/src/Esquio.Http.Store/Esquio.Http.Store.csproj b/src/Esquio.Http.Store/Esquio.Http.Store.csproj index ca084f7f..99e829f9 100644 --- a/src/Esquio.Http.Store/Esquio.Http.Store.csproj +++ b/src/Esquio.Http.Store/Esquio.Http.Store.csproj @@ -1,7 +1,7 @@  - $(NetStandardMultiTarget) + $(NetFrameworkVersion) Distributed store support for Esquio. For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore;Store;Distributed Store $(esquiohttpstore) diff --git a/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj b/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj index 3b340491..691334e5 100644 --- a/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj +++ b/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj @@ -1,11 +1,11 @@  - $(NetStandardTargetVersion21) + $(NetFrameworkVersion) - + diff --git a/src/Esquio.UI.Api/Esquio.UI.Api.csproj b/src/Esquio.UI.Api/Esquio.UI.Api.csproj index 74b49b64..150c6ef7 100644 --- a/src/Esquio.UI.Api/Esquio.UI.Api.csproj +++ b/src/Esquio.UI.Api/Esquio.UI.Api.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) true latest @@ -43,9 +43,9 @@ - + diff --git a/src/Esquio.UI.Client/Components/Validation/EditContextFluentValidationExtensions.cs b/src/Esquio.UI.Client/Components/Validation/EditContextFluentValidationExtensions.cs index 5d602651..edb054aa 100644 --- a/src/Esquio.UI.Client/Components/Validation/EditContextFluentValidationExtensions.cs +++ b/src/Esquio.UI.Client/Components/Validation/EditContextFluentValidationExtensions.cs @@ -7,6 +7,7 @@ namespace Esquio.UI.Client.Components.Validation { + //TODO: review validation context generics here public static class EditContextFluentValidationExtensions { public static EditContext AddFluentValidation(this EditContext editContext) @@ -42,7 +43,9 @@ public static bool IsValid(this EditContext editContext) private static void ValidateModel(EditContext editContext, ValidationMessageStore messages) { var validator = GetValidatorForModel(editContext.Model); - var validationResults = validator.Validate(editContext.Model); + + var validationResults = validator.Validate( + new ValidationContext(editContext.Model)); messages.Clear(); @@ -57,7 +60,8 @@ private static void ValidateModel(EditContext editContext, ValidationMessageStor private static void ValidateField(EditContext editContext, ValidationMessageStore messages, in FieldIdentifier fieldIdentifier) { var properties = new[] { fieldIdentifier.FieldName }; - var context = new ValidationContext(fieldIdentifier.Model, new PropertyChain(), new MemberNameValidatorSelector(properties)); + + var context = new ValidationContext(fieldIdentifier.Model, new PropertyChain(), new MemberNameValidatorSelector(properties)); var validator = GetValidatorForModel(fieldIdentifier.Model); var validationResults = validator.Validate(context); diff --git a/src/Esquio.UI.Client/Esquio.UI.Client.csproj b/src/Esquio.UI.Client/Esquio.UI.Client.csproj index c230de21..eb111d5d 100644 --- a/src/Esquio.UI.Client/Esquio.UI.Client.csproj +++ b/src/Esquio.UI.Client/Esquio.UI.Client.csproj @@ -1,7 +1,7 @@  - $(NetStandardTargetVersion21) + $(NetFrameworkVersion) $(RazorLangVersion) @@ -10,7 +10,7 @@ - + diff --git a/src/Esquio.UI.Client/Pages/Products.razor b/src/Esquio.UI.Client/Pages/Products.razor index 86ca0eec..bfdc692b 100644 --- a/src/Esquio.UI.Client/Pages/Products.razor +++ b/src/Esquio.UI.Client/Pages/Products.razor @@ -102,7 +102,7 @@
- + @status
diff --git a/src/Esquio.UI.Host/Esquio.UI.Host.csproj b/src/Esquio.UI.Host/Esquio.UI.Host.csproj index 0f84c4ad..aa9e0316 100644 --- a/src/Esquio.UI.Host/Esquio.UI.Host.csproj +++ b/src/Esquio.UI.Host/Esquio.UI.Host.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) @@ -13,7 +13,7 @@ - + diff --git a/src/Esquio.UI.Host/appsettings.json b/src/Esquio.UI.Host/appsettings.json index 6cd1c6ef..e8a020e0 100644 --- a/src/Esquio.UI.Host/appsettings.json +++ b/src/Esquio.UI.Host/appsettings.json @@ -12,7 +12,7 @@ } }, { - "Name": "ColoredConsole", + "Name": "Console", "Args": { "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {Level} {MachineName} {SourceContext} {Message} {Exception} {NewLine}" } diff --git a/src/Esquio/Esquio.csproj b/src/Esquio/Esquio.csproj index 6e94d595..8832f01b 100644 --- a/src/Esquio/Esquio.csproj +++ b/src/Esquio/Esquio.csproj @@ -1,8 +1,8 @@  - $(NetStandardMultiTarget) - Feature Toogles Library for .NET Core.For more information see http://github.com/Xabaril/Esquio + $(NetFrameworkVersion) + Feature Toogles Library for .NET .For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore $(esquio) Esquio diff --git a/tests/FunctionalTests/FunctionalTests.csproj b/tests/FunctionalTests/FunctionalTests.csproj index 7e35afeb..3fe7f35b 100644 --- a/tests/FunctionalTests/FunctionalTests.csproj +++ b/tests/FunctionalTests/FunctionalTests.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) false diff --git a/tests/UnitTests/UnitTests.csproj b/tests/UnitTests/UnitTests.csproj index f3fae6ec..04bb86f9 100644 --- a/tests/UnitTests/UnitTests.csproj +++ b/tests/UnitTests/UnitTests.csproj @@ -1,7 +1,7 @@  - $(NetCoreTargetVersion) + $(NetFrameworkVersion) false diff --git a/tools/Esquio.CliTool/Esquio.CliTool.csproj b/tools/Esquio.CliTool/Esquio.CliTool.csproj index 9de79a7d..d07474dc 100644 --- a/tools/Esquio.CliTool/Esquio.CliTool.csproj +++ b/tools/Esquio.CliTool/Esquio.CliTool.csproj @@ -3,7 +3,7 @@ Exe true - $(NetCoreTargetVersion) + $(NetFrameworkVersion) dotnet-esquio Esquio.Cli $(esquiocli) diff --git a/tools/Esquio.CliTool/Internal/EsquioClient.cs b/tools/Esquio.CliTool/Internal/EsquioClient.cs index c136b4c5..02a553b1 100644 --- a/tools/Esquio.CliTool/Internal/EsquioClient.cs +++ b/tools/Esquio.CliTool/Internal/EsquioClient.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v13.6.2.0 (NJsonSchema v10.1.23.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) // //---------------------- @@ -14,7 +14,7 @@ namespace Esquio.CliTool.Internal { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.6.2.0 (NJsonSchema v10.1.23.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] public partial class EsquioClient { private string _baseUrl = ""; @@ -71,6 +71,7 @@ public async System.Threading.Tasks.Task Audit_ListAsync(int? urlBuilder_.Length--; var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -84,6 +85,7 @@ public async System.Threading.Tasks.Task Audit_ListAsync(int? PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -95,36 +97,43 @@ public async System.Threading.Tasks.Task Audit_ListAsync(int? ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(ListAuditRequest); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -151,6 +160,7 @@ public async System.Threading.Tasks.Task h_.Key, h_ => h_.Value); @@ -175,36 +186,43 @@ public async System.Threading.Tasks.Task(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(PaginatedResultOfListApiKeyResponseDetail); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -225,6 +243,7 @@ public async System.Threading.Tasks.Task ApiKeys_AddAsync(AddApiKeyRequest reque urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/ApiKeys"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -240,6 +259,7 @@ public async System.Threading.Tasks.Task ApiKeys_AddAsync(AddApiKeyRequest reque PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -251,39 +271,48 @@ public async System.Threading.Tasks.Task ApiKeys_AddAsync(AddApiKeyRequest reque ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") + var status_ = (int)response_.StatusCode; + if (status_ == 201) { return; } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -305,6 +334,7 @@ public async System.Threading.Tasks.Task ApiKeys_GetAsync urlBuilder_.Replace("{name}", System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -318,6 +348,7 @@ public async System.Threading.Tasks.Task ApiKeys_GetAsync PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -329,42 +360,49 @@ public async System.Threading.Tasks.Task ApiKeys_GetAsync ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "404") + if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(DetailsApiKeyResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -386,6 +424,7 @@ public async System.Threading.Tasks.Task ApiKeys_DeleteAsync(string name, System urlBuilder_.Replace("{name}", System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -398,6 +437,7 @@ public async System.Threading.Tasks.Task ApiKeys_DeleteAsync(string name, System PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -409,33 +449,38 @@ public async System.Threading.Tasks.Task ApiKeys_DeleteAsync(string name, System ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -460,6 +505,7 @@ public async System.Threading.Tasks.Task Features_AddAsync(string productName, A urlBuilder_.Replace("{productName}", System.Uri.EscapeDataString(ConvertToString(productName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -475,6 +521,7 @@ public async System.Threading.Tasks.Task Features_AddAsync(string productName, A PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -486,45 +533,50 @@ public async System.Threading.Tasks.Task Features_AddAsync(string productName, A ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") + var status_ = (int)response_.StatusCode; + if (status_ == 201) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -555,6 +607,7 @@ public async System.Threading.Tasks.Task h_.Key, h_ => h_.Value); @@ -579,42 +633,49 @@ public async System.Threading.Tasks.Task(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(PaginatedResultOfListFeatureResponseDetail); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -643,6 +704,7 @@ public async System.Threading.Tasks.Task Features_UpdateAsync(string productName urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -658,6 +720,7 @@ public async System.Threading.Tasks.Task Features_UpdateAsync(string productName PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -669,45 +732,50 @@ public async System.Threading.Tasks.Task Features_UpdateAsync(string productName ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -733,6 +801,7 @@ public async System.Threading.Tasks.Task Features_DeleteAsync(string productName urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -745,6 +814,7 @@ public async System.Threading.Tasks.Task Features_DeleteAsync(string productName PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -756,45 +826,50 @@ public async System.Threading.Tasks.Task Features_DeleteAsync(string productName ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -820,6 +895,7 @@ public async System.Threading.Tasks.Task Features_GetAsy urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -833,6 +909,7 @@ public async System.Threading.Tasks.Task Features_GetAsy PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -844,48 +921,55 @@ public async System.Threading.Tasks.Task Features_GetAsy ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "404") + if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(DetailsFeatureResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -915,6 +999,7 @@ public async System.Threading.Tasks.Task Features_RolloutAsync(string productNam urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -928,6 +1013,7 @@ public async System.Threading.Tasks.Task Features_RolloutAsync(string productNam PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -939,45 +1025,50 @@ public async System.Threading.Tasks.Task Features_RolloutAsync(string productNam ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1007,6 +1098,7 @@ public async System.Threading.Tasks.Task Features_RollbackAsync(string productNa urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1020,6 +1112,7 @@ public async System.Threading.Tasks.Task Features_RollbackAsync(string productNa PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1031,45 +1124,50 @@ public async System.Threading.Tasks.Task Features_RollbackAsync(string productNa ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1095,6 +1193,7 @@ public async System.Threading.Tasks.Task Features_ArchiveAsync(string productNam urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1108,6 +1207,7 @@ public async System.Threading.Tasks.Task Features_ArchiveAsync(string productNam PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1119,45 +1219,50 @@ public async System.Threading.Tasks.Task Features_ArchiveAsync(string productNam ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1183,6 +1288,7 @@ public async System.Threading.Tasks.Task Features_GetState urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1196,6 +1302,7 @@ public async System.Threading.Tasks.Task Features_GetState PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1207,48 +1314,55 @@ public async System.Threading.Tasks.Task Features_GetState ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "404") + if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(StateFeatureResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1266,6 +1380,7 @@ public async System.Threading.Tasks.Task Permissions_MyAsync(System. urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Permissions/my"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1279,6 +1394,7 @@ public async System.Threading.Tasks.Task Permissions_MyAsync(System. PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1290,42 +1406,49 @@ public async System.Threading.Tasks.Task Permissions_MyAsync(System. ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(MyResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1352,6 +1475,7 @@ public async System.Threading.Tasks.Task h_.Key, h_ => h_.Value); @@ -1376,36 +1501,43 @@ public async System.Threading.Tasks.Task(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(PaginatedResultOfListUsersResponseDetail); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1426,6 +1558,7 @@ public async System.Threading.Tasks.Task Permissions_AddAsync(AddPermissionReque urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Permissions"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1441,6 +1574,7 @@ public async System.Threading.Tasks.Task Permissions_AddAsync(AddPermissionReque PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1452,33 +1586,38 @@ public async System.Threading.Tasks.Task Permissions_AddAsync(AddPermissionReque ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { return; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1499,6 +1638,7 @@ public async System.Threading.Tasks.Task Permissions_UpdateAsync(UpdatePermissio urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Permissions"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1514,6 +1654,7 @@ public async System.Threading.Tasks.Task Permissions_UpdateAsync(UpdatePermissio PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1525,33 +1666,38 @@ public async System.Threading.Tasks.Task Permissions_UpdateAsync(UpdatePermissio ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1573,6 +1719,7 @@ public async System.Threading.Tasks.Task Permissions_ urlBuilder_.Replace("{subjectId}", System.Uri.EscapeDataString(ConvertToString(subjectId, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1586,6 +1733,7 @@ public async System.Threading.Tasks.Task Permissions_ PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1597,36 +1745,43 @@ public async System.Threading.Tasks.Task Permissions_ ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(DetailsPermissionResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1648,6 +1803,7 @@ public async System.Threading.Tasks.Task Permissions_DeleteAsync(string subjectI urlBuilder_.Replace("{subjectId}", System.Uri.EscapeDataString(ConvertToString(subjectId, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1660,6 +1816,7 @@ public async System.Threading.Tasks.Task Permissions_DeleteAsync(string subjectI PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1671,33 +1828,38 @@ public async System.Threading.Tasks.Task Permissions_DeleteAsync(string subjectI ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "500") + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1724,6 +1886,7 @@ public async System.Threading.Tasks.Task h_.Key, h_ => h_.Value); @@ -1748,42 +1912,49 @@ public async System.Threading.Tasks.Task(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(PaginatedResultOfListProductResponseDetail); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1804,6 +1975,7 @@ public async System.Threading.Tasks.Task Products_AddAsync(AddProductRequest req urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Products"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1819,6 +1991,7 @@ public async System.Threading.Tasks.Task Products_AddAsync(AddProductRequest req PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1830,45 +2003,50 @@ public async System.Threading.Tasks.Task Products_AddAsync(AddProductRequest req ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") + var status_ = (int)response_.StatusCode; + if (status_ == 201) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1890,6 +2068,7 @@ public async System.Threading.Tasks.Task Products_GetAsy urlBuilder_.Replace("{productName}", System.Uri.EscapeDataString(ConvertToString(productName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1903,6 +2082,7 @@ public async System.Threading.Tasks.Task Products_GetAsy PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -1914,48 +2094,55 @@ public async System.Threading.Tasks.Task Products_GetAsy ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "404") + if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(DetailsProductResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -1980,6 +2167,7 @@ public async System.Threading.Tasks.Task Products_UpdateAsync(string productName urlBuilder_.Replace("{productName}", System.Uri.EscapeDataString(ConvertToString(productName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1995,6 +2183,7 @@ public async System.Threading.Tasks.Task Products_UpdateAsync(string productName PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2006,45 +2195,50 @@ public async System.Threading.Tasks.Task Products_UpdateAsync(string productName ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2066,6 +2260,7 @@ public async System.Threading.Tasks.Task Products_DeleteAsync(string productName urlBuilder_.Replace("{productName}", System.Uri.EscapeDataString(ConvertToString(productName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2078,6 +2273,7 @@ public async System.Threading.Tasks.Task Products_DeleteAsync(string productName PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2089,45 +2285,50 @@ public async System.Threading.Tasks.Task Products_DeleteAsync(string productName ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2149,6 +2350,7 @@ public async System.Threading.Tasks.Task Products_ExportA urlBuilder_.Replace("{productName}", System.Uri.EscapeDataString(ConvertToString(productName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2162,6 +2364,7 @@ public async System.Threading.Tasks.Task Products_ExportA PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2173,48 +2376,55 @@ public async System.Threading.Tasks.Task Products_ExportA ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "404") + if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(ExportProductResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2235,6 +2445,7 @@ public async System.Threading.Tasks.Task Products_ImportAsync(ImportProductReque urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Products/import"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2250,6 +2461,7 @@ public async System.Threading.Tasks.Task Products_ImportAsync(ImportProductReque PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2261,45 +2473,50 @@ public async System.Threading.Tasks.Task Products_ImportAsync(ImportProductReque ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { return; } else - if (status_ == "404") + if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2325,6 +2542,7 @@ public async System.Threading.Tasks.Task Products_DeleteDeploymentAsync(string p urlBuilder_.Replace("{deploymentName}", System.Uri.EscapeDataString(ConvertToString(deploymentName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2337,6 +2555,7 @@ public async System.Threading.Tasks.Task Products_DeleteDeploymentAsync(string p PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2348,39 +2567,40 @@ public async System.Threading.Tasks.Task Products_DeleteDeploymentAsync(string p ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2405,6 +2625,7 @@ public async System.Threading.Tasks.Task Products_AddDeploymentAsync(string prod urlBuilder_.Replace("{productName}", System.Uri.EscapeDataString(ConvertToString(productName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2420,6 +2641,7 @@ public async System.Threading.Tasks.Task Products_AddDeploymentAsync(string prod PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2431,45 +2653,50 @@ public async System.Threading.Tasks.Task Products_AddDeploymentAsync(string prod ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") + var status_ = (int)response_.StatusCode; + if (status_ == 201) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2487,6 +2714,7 @@ public async System.Threading.Tasks.Task Statistics_GetConfigurationStatisticsAs urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Statistics/configuration"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2499,6 +2727,7 @@ public async System.Threading.Tasks.Task Statistics_GetConfigurationStatisticsAs PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2510,28 +2739,34 @@ public async System.Threading.Tasks.Task Statistics_GetConfigurationStatisticsAs ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "500") + var status_ = (int)response_.StatusCode; + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); + } + else + if (status_ == 200 || status_ == 204) + { + return; } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2549,6 +2784,7 @@ public async System.Threading.Tasks.Task Statistics_GetSuccessStatisticsAsync(Sy urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Statistics/success"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2561,6 +2797,7 @@ public async System.Threading.Tasks.Task Statistics_GetSuccessStatisticsAsync(Sy PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2572,28 +2809,34 @@ public async System.Threading.Tasks.Task Statistics_GetSuccessStatisticsAsync(Sy ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "500") + var status_ = (int)response_.StatusCode; + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); + } + else + if (status_ == 200 || status_ == 204) + { + return; } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2611,6 +2854,7 @@ public async System.Threading.Tasks.Task Statistics_GetTopFeaturesStatisticsAsyn urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Statistics/top"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2623,6 +2867,7 @@ public async System.Threading.Tasks.Task Statistics_GetTopFeaturesStatisticsAsyn PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2634,28 +2879,34 @@ public async System.Threading.Tasks.Task Statistics_GetTopFeaturesStatisticsAsyn ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "500") + var status_ = (int)response_.StatusCode; + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); + } + else + if (status_ == 200 || status_ == 204) + { + return; } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2673,6 +2924,7 @@ public async System.Threading.Tasks.Task Statistics_GetPlotStatisticsAsync(Syste urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Statistics/plot"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2685,6 +2937,7 @@ public async System.Threading.Tasks.Task Statistics_GetPlotStatisticsAsync(Syste PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2696,28 +2949,34 @@ public async System.Threading.Tasks.Task Statistics_GetPlotStatisticsAsync(Syste ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "500") + var status_ = (int)response_.StatusCode; + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); + } + else + if (status_ == 200 || status_ == 204) + { + return; } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2741,6 +3000,7 @@ public async System.Threading.Tasks.Task Configura urlBuilder_.Length--; var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2754,6 +3014,7 @@ public async System.Threading.Tasks.Task Configura PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2765,36 +3026,43 @@ public async System.Threading.Tasks.Task Configura ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "500") + var status_ = (int)response_.StatusCode; + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "200") + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(DetailsConfigurationResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2820,6 +3088,7 @@ public async System.Threading.Tasks.Task Configura urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2833,6 +3102,7 @@ public async System.Threading.Tasks.Task Configura PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2844,42 +3114,49 @@ public async System.Threading.Tasks.Task Configura ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(System.Collections.Generic.ICollection); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2909,6 +3186,7 @@ public async System.Threading.Tasks.Task Tags_UntagAsync(string productName, str urlBuilder_.Replace("{tag}", System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2921,6 +3199,7 @@ public async System.Threading.Tasks.Task Tags_UntagAsync(string productName, str PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -2932,45 +3211,50 @@ public async System.Threading.Tasks.Task Tags_UntagAsync(string productName, str ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -2999,6 +3283,7 @@ public async System.Threading.Tasks.Task Tags_TagAsync(string productName, strin urlBuilder_.Replace("{featureName}", System.Uri.EscapeDataString(ConvertToString(featureName, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3014,6 +3299,7 @@ public async System.Threading.Tasks.Task Tags_TagAsync(string productName, strin PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -3025,45 +3311,50 @@ public async System.Threading.Tasks.Task Tags_TagAsync(string productName, strin ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -3093,6 +3384,7 @@ public async System.Threading.Tasks.Task Toggles_DetailsA urlBuilder_.Replace("{toggleType}", System.Uri.EscapeDataString(ConvertToString(toggleType, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3106,6 +3398,7 @@ public async System.Threading.Tasks.Task Toggles_DetailsA PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -3117,42 +3410,49 @@ public async System.Threading.Tasks.Task Toggles_DetailsA ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(DetailsToggleResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -3182,6 +3482,7 @@ public async System.Threading.Tasks.Task Toggles_DeleteAsync(string productName, urlBuilder_.Replace("{toggleType}", System.Uri.EscapeDataString(ConvertToString(toggleType, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3194,6 +3495,7 @@ public async System.Threading.Tasks.Task Toggles_DeleteAsync(string productName, PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -3205,45 +3507,50 @@ public async System.Threading.Tasks.Task Toggles_DeleteAsync(string productName, ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") + var status_ = (int)response_.StatusCode; + if (status_ == 204) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -3265,6 +3572,7 @@ public async System.Threading.Tasks.Task Toggles_RevealAsy urlBuilder_.Replace("{toggleType}", System.Uri.EscapeDataString(ConvertToString(toggleType, System.Globalization.CultureInfo.InvariantCulture))); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3278,6 +3586,7 @@ public async System.Threading.Tasks.Task Toggles_RevealAsy PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -3289,42 +3598,49 @@ public async System.Threading.Tasks.Task Toggles_RevealAsy ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(RevealToggleResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -3342,6 +3658,7 @@ public async System.Threading.Tasks.Task Toggles_Known urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/toggles/types"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3355,6 +3672,7 @@ public async System.Threading.Tasks.Task Toggles_Known PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -3366,42 +3684,49 @@ public async System.Threading.Tasks.Task Toggles_Known ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") + var status_ = (int)response_.StatusCode; + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } return objectResponse_.Object; } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } - - return default(KnownTypesToggleResponse); } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -3422,6 +3747,7 @@ public async System.Threading.Tasks.Task Toggles_AddParameterAsync(AddParameterT urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/toggles/parameters"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3437,6 +3763,7 @@ public async System.Threading.Tasks.Task Toggles_AddParameterAsync(AddParameterT PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -3448,45 +3775,50 @@ public async System.Threading.Tasks.Task Toggles_AddParameterAsync(AddParameterT ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") + var status_ = (int)response_.StatusCode; + if (status_ == 201) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -3507,6 +3839,7 @@ public async System.Threading.Tasks.Task Toggles_AddAsync(AddToggleRequest postT urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/toggles"); var client_ = _httpClient; + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3522,6 +3855,7 @@ public async System.Threading.Tasks.Task Toggles_AddAsync(AddToggleRequest postT PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; try { var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); @@ -3533,45 +3867,50 @@ public async System.Threading.Tasks.Task Toggles_AddAsync(AddToggleRequest postT ProcessResponse(client_, response_); - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") + var status_ = (int)response_.StatusCode; + if (status_ == 201) { return; } else - if (status_ == "403") + if (status_ == 403) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ == "400") + if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, objectResponse_.Text, headers_, objectResponse_.Object, null); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == "500") + if (status_ == 500) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("A server side error occurred.", (int)response_.StatusCode, responseText_, headers_, null); + throw new ApiException("A server side error occurred.", status_, responseText_, headers_, null); } else - if (status_ != "200" && status_ != "204") { var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); } } finally { - if (response_ != null) + if (disposeResponse_) response_.Dispose(); } } } finally { + if (disposeClient_) + client_.Dispose(); } } @@ -3634,6 +3973,11 @@ protected virtual async System.Threading.Tasks.Task> Rea private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) { + if (value == null) + { + return null; + } + if (value is System.Enum) { var name = System.Enum.GetName(value.GetType(), value); @@ -3655,23 +3999,24 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } else if (value is bool) { - return System.Convert.ToString(value, cultureInfo)?.ToLowerInvariant(); + return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); } else if (value is byte[]) { return System.Convert.ToBase64String((byte[]) value); } - else if (value != null && value.GetType().IsArray) + else if (value.GetType().IsArray) { var array = System.Linq.Enumerable.OfType((System.Array) value); return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); } - return System.Convert.ToString(value, cultureInfo); + var result = System.Convert.ToString(value, cultureInfo); + return (result is null) ? string.Empty : result; } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListAuditRequest { [Newtonsoft.Json.JsonProperty("pageIndex", Required = Newtonsoft.Json.Required.Always)] @@ -3683,7 +4028,7 @@ public partial class ListAuditRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ProblemDetails { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3707,7 +4052,7 @@ public partial class ProblemDetails } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListApiKeyResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -3725,7 +4070,7 @@ public partial class PaginatedResultOfListApiKeyResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListApiKeyResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3738,7 +4083,7 @@ public partial class ListApiKeyResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsApiKeyResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3754,7 +4099,7 @@ public partial class DetailsApiKeyResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ValidationProblemDetails : ProblemDetails { [Newtonsoft.Json.JsonProperty("errors", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3763,7 +4108,7 @@ public partial class ValidationProblemDetails : ProblemDetails } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddApiKeyRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3778,7 +4123,7 @@ public partial class AddApiKeyRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddFeatureRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3793,7 +4138,7 @@ public partial class AddFeatureRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class UpdateFeatureRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3805,7 +4150,7 @@ public partial class UpdateFeatureRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsFeatureResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3820,7 +4165,7 @@ public partial class DetailsFeatureResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ToggleDetail { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3835,7 +4180,7 @@ public partial class ToggleDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ParameterDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3847,7 +4192,7 @@ public partial class ParameterDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class StateFeatureResponse { [Newtonsoft.Json.JsonProperty("states", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3856,7 +4201,7 @@ public partial class StateFeatureResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class StateFeatureResponseDetail { [Newtonsoft.Json.JsonProperty("deploymentName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3871,7 +4216,7 @@ public partial class StateFeatureResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListFeatureResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -3889,7 +4234,7 @@ public partial class PaginatedResultOfListFeatureResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListFeatureResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3904,7 +4249,7 @@ public partial class ListFeatureResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class MyResponse { [Newtonsoft.Json.JsonProperty("isAuthorized", Required = Newtonsoft.Json.Required.Always)] @@ -3916,7 +4261,7 @@ public partial class MyResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListUsersResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -3934,7 +4279,7 @@ public partial class PaginatedResultOfListUsersResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListUsersResponseDetail { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3946,7 +4291,7 @@ public partial class ListUsersResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsPermissionResponse { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3958,7 +4303,7 @@ public partial class DetailsPermissionResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddPermissionRequest { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3970,7 +4315,7 @@ public partial class AddPermissionRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class UpdatePermissionRequest { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -3982,7 +4327,7 @@ public partial class UpdatePermissionRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListProductResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -4000,7 +4345,7 @@ public partial class PaginatedResultOfListProductResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListProductResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4012,7 +4357,7 @@ public partial class ListProductResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsProductResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4027,7 +4372,7 @@ public partial class DetailsProductResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DeploymentResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4039,7 +4384,7 @@ public partial class DeploymentResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ExportProductResponse { [Newtonsoft.Json.JsonProperty("content", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4048,7 +4393,7 @@ public partial class ExportProductResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ImportProductRequest { [Newtonsoft.Json.JsonProperty("content", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4057,7 +4402,7 @@ public partial class ImportProductRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddProductRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4072,7 +4417,7 @@ public partial class AddProductRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class UpdateProductRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4084,7 +4429,7 @@ public partial class UpdateProductRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddDeploymentRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4093,7 +4438,7 @@ public partial class AddDeploymentRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsConfigurationResponse { [Newtonsoft.Json.JsonProperty("featureName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4108,7 +4453,7 @@ public partial class DetailsConfigurationResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsConfigurationRequest { [Newtonsoft.Json.JsonProperty("productName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4120,7 +4465,7 @@ public partial class DetailsConfigurationRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class TagResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4132,7 +4477,7 @@ public partial class TagResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddTagRequest { [Newtonsoft.Json.JsonProperty("tag", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4144,7 +4489,7 @@ public partial class AddTagRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsToggleResponse { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4165,7 +4510,7 @@ public partial class DetailsToggleResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ParameterDetail2 { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4180,7 +4525,7 @@ public partial class ParameterDetail2 } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class RevealToggleResponse { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4192,7 +4537,7 @@ public partial class RevealToggleResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class RevealToggleParameterResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4207,7 +4552,7 @@ public partial class RevealToggleParameterResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class KnownTypesToggleResponse { [Newtonsoft.Json.JsonProperty("scannedAssemblies", Required = Newtonsoft.Json.Required.Always)] @@ -4219,7 +4564,7 @@ public partial class KnownTypesToggleResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class KnownTypesToggleDetailResponse { [Newtonsoft.Json.JsonProperty("assembly", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4237,7 +4582,7 @@ public partial class KnownTypesToggleDetailResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddParameterToggleRequest { [Newtonsoft.Json.JsonProperty("productName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4261,7 +4606,7 @@ public partial class AddParameterToggleRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddToggleRequest { [Newtonsoft.Json.JsonProperty("productName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4282,7 +4627,7 @@ public partial class AddToggleRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.23.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddToggleRequestDetailParameter { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4297,7 +4642,7 @@ public partial class AddToggleRequestDetailParameter } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.6.2.0 (NJsonSchema v10.1.23.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] public partial class ApiException : System.Exception { public int StatusCode { get; private set; } @@ -4320,7 +4665,7 @@ public override string ToString() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.6.2.0 (NJsonSchema v10.1.23.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] public partial class ApiException : ApiException { public TResult Result { get; private set; } diff --git a/tools/Esquio.MiniProfiler/Esquio.MiniProfiler.csproj b/tools/Esquio.MiniProfiler/Esquio.MiniProfiler.csproj index 5ac12aeb..e0c6f37a 100644 --- a/tools/Esquio.MiniProfiler/Esquio.MiniProfiler.csproj +++ b/tools/Esquio.MiniProfiler/Esquio.MiniProfiler.csproj @@ -1,7 +1,7 @@  - $(NetStandardMultiTarget) + $(NetFrameworkVersion) $(PackageLicenseUrl) $(PackageProjectUrl) MiniProfiler profiling for Esquio.For more information see http://github.com/Xabaril/Esquio From 9a57976242ad5f303e326af28fbc521e66b13cd0 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Thu, 15 Oct 2020 16:51:34 +0200 Subject: [PATCH 02/15] Continue to migrate code for .NET5. Functional and Unit tests on green :-) --- .../Startup.cs | 2 +- .../appsettings.json | 2 +- src/Esquio.Http.Store/EsquioHttpStore.cs | 6 +- src/Esquio.UI.Api/EsquioUIApiConfiguration.cs | 22 ++-- .../Scenarios/ApiKeys/ApiKeysController.cs | 2 +- .../Scenarios/Audit/AuditController.cs | 2 +- .../Configuration/ConfigurationController.cs | 2 +- .../Scenarios/Features/FeaturesController.cs | 2 +- .../Scenarios/Permissions/UsersController.cs | 2 +- .../Scenarios/Products/ProductsController.cs | 2 +- .../Statistics/StatisticsController.cs | 2 +- .../Scenarios/Tags/TagsController.cs | 2 +- .../Scenarios/Toggles/TogglesController.cs | 2 +- .../Esquio.Http.Store/EsquioHttpStoreTests.cs | 2 +- .../Esquio.UI.Api/Scenarios/ApiDefinitions.cs | 92 +++++++-------- .../ApiKeys/ApiKeysControllerTests.cs | 40 +++---- .../Scenarios/Audit/AuditControllerTests.cs | 8 +- .../Features/FeaturesControllerTests.cs | 108 +++++++++--------- .../Permissions/PermissionsControllerTests.cs | 52 ++++----- .../Products/ProductControllerTests.cs | 104 ++++++++--------- .../Statistics/StatisticsControllerTests.cs | 14 +-- .../Store/ConfigurationControllerTests.cs | 8 +- .../Scenarios/Tags/TagsControllerTests.cs | 24 ++-- .../Scenarios/Toggles/ToggleControlerTests.cs | 66 +++++------ .../Scenarios/Versioning/VersioningTests.cs | 6 +- 25 files changed, 288 insertions(+), 286 deletions(-) diff --git a/samples/GettingStarted.AspNetCore.EvaluationSession/Startup.cs b/samples/GettingStarted.AspNetCore.EvaluationSession/Startup.cs index 8e9f3af4..29fe2655 100644 --- a/samples/GettingStarted.AspNetCore.EvaluationSession/Startup.cs +++ b/samples/GettingStarted.AspNetCore.EvaluationSession/Startup.cs @@ -54,7 +54,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { endpoints.MapControllerRoute( name: "default", - pattern: "{controller=Home}/{action=Index}/{id?}").RequireFeature("HiddenGem"); + pattern: "{controller=Home}/{action=Index}/{id?}"); }); } } diff --git a/samples/GettingStarted.AspNetCore.EvaluationSession/appsettings.json b/samples/GettingStarted.AspNetCore.EvaluationSession/appsettings.json index 8ffc5825..ca904de7 100644 --- a/samples/GettingStarted.AspNetCore.EvaluationSession/appsettings.json +++ b/samples/GettingStarted.AspNetCore.EvaluationSession/appsettings.json @@ -14,7 +14,7 @@ "Features": [ { "Name": "PrivacyFeature", - "Enabled": false, + "Enabled": true, "Toggles": [] }, { diff --git a/src/Esquio.Http.Store/EsquioHttpStore.cs b/src/Esquio.Http.Store/EsquioHttpStore.cs index e4a6897e..90ae403d 100644 --- a/src/Esquio.Http.Store/EsquioHttpStore.cs +++ b/src/Esquio.Http.Store/EsquioHttpStore.cs @@ -14,6 +14,8 @@ namespace Esquio.Http.Store internal class EsquioHttpStore : IRuntimeFeatureStore { + private const string DEFAULT_API_VERSION = "5.0"; + private readonly IHttpClientFactory _httpClientFactory; private readonly IDistributedCache _cache; private readonly HttpStoreOptions _options; @@ -53,7 +55,7 @@ private async Task GetFeatureConfiguration(string featureName, string pr throw new InvalidOperationException("HttpStore is configured with CacheEnabled = true but IDistributedCache is not registered."); } - var cacheKey = CacheKeyCreator.GetCacheKey(productName, featureName, deploymentName, "3.0"); + var cacheKey = CacheKeyCreator.GetCacheKey(productName, featureName, deploymentName, DEFAULT_API_VERSION); var featureConfiguration = await _cache.GetStringAsync(cacheKey, cancellationToken); @@ -97,7 +99,7 @@ private async Task GetFeatureFromServer(string productName, string featu .CreateClient(EsquioConstants.ESQUIO); var response = await httpClient - .GetAsync($"api/configuration/product/{productName}/feature/{featureName}?deployment={deploymentName}&api-version=3.0", cancellationToken); + .GetAsync($"api/configuration/product/{productName}/feature/{featureName}?deployment={deploymentName}&api-version={DEFAULT_API_VERSION}", cancellationToken); if (response.IsSuccessStatusCode) { diff --git a/src/Esquio.UI.Api/EsquioUIApiConfiguration.cs b/src/Esquio.UI.Api/EsquioUIApiConfiguration.cs index d2587d40..8cc10f48 100644 --- a/src/Esquio.UI.Api/EsquioUIApiConfiguration.cs +++ b/src/Esquio.UI.Api/EsquioUIApiConfiguration.cs @@ -38,17 +38,6 @@ public static IServiceCollection ConfigureServices(IServiceCollection services,I .AddMediatR(typeof(EsquioUIApiConfiguration)) .AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggerMediatRBehavior<,>)) .AddCustomProblemDetails() - .AddApiVersioning(setup => - { - setup.DefaultApiVersion = new ApiVersion(3, 0); - setup.ReportApiVersions = true; - setup.AssumeDefaultVersionWhenUnspecified = true; - setup.UseApiBehavior = true; - setup.ApiVersionReader = ApiVersionReader.Combine( - new QueryStringApiVersionReader(), - new HeaderApiVersionReader(ApiConstants.ApiVersionHeaderName)); - }) - .AddVersionedApiExplorer() .AddMvc() .AddApplicationPart(typeof(EsquioUIApiConfiguration).Assembly) .AddFluentValidation(setup => @@ -61,6 +50,17 @@ public static IServiceCollection ConfigureServices(IServiceCollection services,I options.JsonSerializerOptions.Converters.Add(new NumberToStringConverter()); }) .Services + .AddApiVersioning(setup => + { + setup.DefaultApiVersion = new ApiVersion(5, 0); + setup.ReportApiVersions = true; + setup.AssumeDefaultVersionWhenUnspecified = true; + setup.UseApiBehavior = true; + setup.ApiVersionReader = ApiVersionReader.Combine( + new QueryStringApiVersionReader(), + new HeaderApiVersionReader(ApiConstants.ApiVersionHeaderName)); + }) + .AddVersionedApiExplorer() .Configure(options => { options.ConstraintMap.Add("slug", typeof(SlugRouteConstraint)); diff --git a/src/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysController.cs b/src/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysController.cs index 69b0ae34..ce1fbae7 100644 --- a/src/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysController.cs +++ b/src/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysController.cs @@ -15,7 +15,7 @@ namespace Esquio.UI.Api.Scenarios.ApiKeys { [Authorize()] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [ApiController] [Route("api/[controller]")] public class ApiKeysController : ControllerBase diff --git a/src/Esquio.UI.Api/Scenarios/Audit/AuditController.cs b/src/Esquio.UI.Api/Scenarios/Audit/AuditController.cs index 297ea5da..98d8059a 100644 --- a/src/Esquio.UI.Api/Scenarios/Audit/AuditController.cs +++ b/src/Esquio.UI.Api/Scenarios/Audit/AuditController.cs @@ -12,7 +12,7 @@ namespace Esquio.UI.Api.Features.Audit { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [ApiController] public class AuditController : ControllerBase { diff --git a/src/Esquio.UI.Api/Scenarios/Configuration/ConfigurationController.cs b/src/Esquio.UI.Api/Scenarios/Configuration/ConfigurationController.cs index e7b7d763..0556d15f 100644 --- a/src/Esquio.UI.Api/Scenarios/Configuration/ConfigurationController.cs +++ b/src/Esquio.UI.Api/Scenarios/Configuration/ConfigurationController.cs @@ -10,7 +10,7 @@ namespace Esquio.UI.Api.Scenarios.Store { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [Route("api/[controller]")] [ApiController] public class ConfigurationController diff --git a/src/Esquio.UI.Api/Scenarios/Features/FeaturesController.cs b/src/Esquio.UI.Api/Scenarios/Features/FeaturesController.cs index a41cbffc..fd634971 100644 --- a/src/Esquio.UI.Api/Scenarios/Features/FeaturesController.cs +++ b/src/Esquio.UI.Api/Scenarios/Features/FeaturesController.cs @@ -20,7 +20,7 @@ namespace Esquio.UI.Api.Scenarios.Flags { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [ApiController] public class FeaturesController : ControllerBase { diff --git a/src/Esquio.UI.Api/Scenarios/Permissions/UsersController.cs b/src/Esquio.UI.Api/Scenarios/Permissions/UsersController.cs index 053793f6..59a333f6 100644 --- a/src/Esquio.UI.Api/Scenarios/Permissions/UsersController.cs +++ b/src/Esquio.UI.Api/Scenarios/Permissions/UsersController.cs @@ -20,7 +20,7 @@ namespace Esquio.UI.Api.Scenarios.Permissions { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [Route("api/[controller]")] [ApiController] public class PermissionsController diff --git a/src/Esquio.UI.Api/Scenarios/Products/ProductsController.cs b/src/Esquio.UI.Api/Scenarios/Products/ProductsController.cs index 19025643..964c2289 100644 --- a/src/Esquio.UI.Api/Scenarios/Products/ProductsController.cs +++ b/src/Esquio.UI.Api/Scenarios/Products/ProductsController.cs @@ -22,7 +22,7 @@ namespace Esquio.UI.Api.Scenarios.Products { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [Route("api/[controller]")] [ApiController] public class ProductsController : ControllerBase diff --git a/src/Esquio.UI.Api/Scenarios/Statistics/StatisticsController.cs b/src/Esquio.UI.Api/Scenarios/Statistics/StatisticsController.cs index a49f02ff..87a24600 100644 --- a/src/Esquio.UI.Api/Scenarios/Statistics/StatisticsController.cs +++ b/src/Esquio.UI.Api/Scenarios/Statistics/StatisticsController.cs @@ -14,7 +14,7 @@ namespace Esquio.UI.Api.Scenarios.Statistics { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [ApiController] [Route("api/[controller]")] public class StatisticsController : ControllerBase diff --git a/src/Esquio.UI.Api/Scenarios/Tags/TagsController.cs b/src/Esquio.UI.Api/Scenarios/Tags/TagsController.cs index dbd0a140..a6fad6f7 100644 --- a/src/Esquio.UI.Api/Scenarios/Tags/TagsController.cs +++ b/src/Esquio.UI.Api/Scenarios/Tags/TagsController.cs @@ -14,7 +14,7 @@ namespace Esquio.UI.Api.Scenarios.Tags { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [ApiController] public class TagsController : ControllerBase { diff --git a/src/Esquio.UI.Api/Scenarios/Toggles/TogglesController.cs b/src/Esquio.UI.Api/Scenarios/Toggles/TogglesController.cs index 8707b8ba..dbce14cd 100644 --- a/src/Esquio.UI.Api/Scenarios/Toggles/TogglesController.cs +++ b/src/Esquio.UI.Api/Scenarios/Toggles/TogglesController.cs @@ -16,7 +16,7 @@ namespace Esquio.UI.Api.Scenarios.Toggles { [Authorize] - [ApiVersion("3.0")] + [ApiVersion("5.0")] [ApiController] public class TogglesController : ControllerBase { diff --git a/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs b/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs index 093aa416..1d25b798 100644 --- a/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs +++ b/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs @@ -274,7 +274,7 @@ await _fixture.Given .Should() .BeEquivalentTo(feature.Name); - var cacheKey = CacheKeyCreator.GetCacheKey(product.Name, feature.Name, defaultRing.Name,"3.0"); + var cacheKey = CacheKeyCreator.GetCacheKey(product.Name, feature.Name, defaultRing.Name,"5.0"); var entry = await cache.GetStringAsync(cacheKey); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiDefinitions.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiDefinitions.cs index 6796fc3a..b7439819 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiDefinitions.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiDefinitions.cs @@ -2,62 +2,62 @@ { public static class ApiDefinitions { - public static class V3 + public static class V5 { public static class Product { public static string List() { - return $"api/products?api-version=3.0"; + return $"api/products?api-version=5.0"; } public static string Add() { - return $"api/products?api-version=3.0"; + return $"api/products?api-version=5.0"; } public static string AddDeployment(string productName) { - return $"api/products/{productName}/deployment?api-version=3.0"; + return $"api/products/{productName}/deployment?api-version=5.0"; } public static string Update(string productName) { - return $"api/products/{productName}?api-version=3.0"; + return $"api/products/{productName}?api-version=5.0"; } public static string Delete(string name) { - return $"api/products/{name}?api-version=3.0"; + return $"api/products/{name}?api-version=5.0"; } public static string DeleteDeployment(string productName, string deploymentName) { - return $"api/products/{productName}/deployment/{deploymentName}?api-version=3.0"; + return $"api/products/{productName}/deployment/{deploymentName}?api-version=5.0"; } public static string Get(string name) { - return $"api/products/{name}?api-version=3.0"; + return $"api/products/{name}?api-version=5.0"; } public static string Export(string name) { - return $"api/products/{name}/export?api-version=3.0"; + return $"api/products/{name}/export?api-version=5.0"; } public static string Import() { - return $"api/products/import?api-version=3.0"; + return $"api/products/import?api-version=5.0"; } public static string List(int pageIndex = 0, int pageCount = 10) { - return $"api/products?pageIndex={pageIndex}&pageCount={pageCount}&api-version=3.0"; + return $"api/products?pageIndex={pageIndex}&pageCount={pageCount}&api-version=5.0"; } } public static class Audit { public static string List() { - return $"api/audit?api-version=3.0"; + return $"api/audit?api-version=5.0"; } public static string List(int pageIndex, int pageCount) { - return $"api/audit?pageIndex={pageIndex}&pageCount={pageCount}&api-version=3.0"; + return $"api/audit?pageIndex={pageIndex}&pageCount={pageCount}&api-version=5.0"; } } @@ -65,36 +65,36 @@ public static class Features { public static string Add(string productName) { - return $"api/products/{productName}/features?api-version=3.0"; + return $"api/products/{productName}/features?api-version=5.0"; } public static string Update(string productName, string featureName) { - return $"api/products/{productName}/features/{featureName}?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}?api-version=5.0"; } public static string Rollout(string productName, string deploymentName, string featureName) { - return $"api/products/{productName}/deployments/{deploymentName}/features/{featureName}/rollout?api-version=3.0"; + return $"api/products/{productName}/deployments/{deploymentName}/features/{featureName}/rollout?api-version=5.0"; } public static string Rollback(string productName, string deploymentName,string featureName) { - return $"api/products/{productName}/deployments/{deploymentName}/features/{featureName}/rollback?api-version=3.0"; + return $"api/products/{productName}/deployments/{deploymentName}/features/{featureName}/rollback?api-version=5.0"; } public static string Archive(string productName, string featureName) { - return $"api/products/{productName}/features/{featureName}/archive?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}/archive?api-version=5.0"; } public static string Delete(string productName, string featureName) { - return $"api/products/{productName}/features/{featureName}?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}?api-version=5.0"; } public static string Get(string productName, string featureName) { - return $"api/products/{productName}/features/{featureName}?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}?api-version=5.0"; } public static string GetState(string productName, string featureName) { - return $"api/products/{productName}/features/{featureName}/state?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}/state?api-version=5.0"; } public static string List(string productName) { @@ -102,7 +102,7 @@ public static string List(string productName) } public static string List(string productName, int pageIndex, int pageCount) { - return $"api/products/{productName}/features?pageIndex={pageIndex}&pageCount={pageCount}&api-version=3.0"; + return $"api/products/{productName}/features?pageIndex={pageIndex}&pageCount={pageCount}&api-version=5.0"; } } @@ -110,7 +110,7 @@ public static class Configuration { public static string Get(string productName, string featureName, string deployment) { - return $"api/configuration/product/{productName}/feature/{featureName}?deployment={deployment}&api-version=3.0"; + return $"api/configuration/product/{productName}/feature/{featureName}?deployment={deployment}&api-version=5.0"; } } @@ -118,23 +118,23 @@ public static class ApiKeys { public static string Add() { - return $"api/apikeys?api-version=3.0"; + return $"api/apikeys?api-version=5.0"; } public static string Delete(string name) { - return $"api/apikeys/{name}?api-version=3.0"; + return $"api/apikeys/{name}?api-version=5.0"; } public static string Get(string name) { - return $"api/apikeys/{name}?api-version=3.0"; + return $"api/apikeys/{name}?api-version=5.0"; } public static string List() { - return $"api/apikeys?api-version=3.0"; + return $"api/apikeys?api-version=5.0"; } public static string List(int pageIndex, int pageCount) { - return $"api/apikeys?pageIndex={pageIndex}&pageCount={pageCount}&api-version=3.0"; + return $"api/apikeys?pageIndex={pageIndex}&pageCount={pageCount}&api-version=5.0"; } } @@ -142,27 +142,27 @@ public static class Toggles { public static string Get(string productName, string featureName, string toggleType) { - return $"api/products/{productName}/features/{featureName}/toggles/{toggleType}?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}/toggles/{toggleType}?api-version=5.0"; } public static string Delete(string productName, string featureName, string toggleType) { - return $"api/products/{productName}/features/{featureName}/toggles/{toggleType}?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}/toggles/{toggleType}?api-version=5.0"; } public static string Reveal(string toggleType) { - return $"api/toggles/parameters/{toggleType}?api-version=3.0"; + return $"api/toggles/parameters/{toggleType}?api-version=5.0"; } public static string KnownTypes() { - return $"api/toggles/types?api-version=3.0"; + return $"api/toggles/types?api-version=5.0"; } public static string Post() { - return "api/toggles?api-version=3.0"; + return "api/toggles?api-version=5.0"; } public static string PostParameter() { - return $"api/toggles/parameters?api-version=3.0"; + return $"api/toggles/parameters?api-version=5.0"; } } @@ -170,17 +170,17 @@ public static class Tags { public static string List(string productName, string featureName) { - return $"api/products/{productName}/features/{featureName}/tags?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}/tags?api-version=5.0"; } public static string Untag(string productName, string featureName, string tag) { - return $"api/products/{productName}/features/{featureName}/tags/untag/{tag}?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}/tags/untag/{tag}?api-version=5.0"; } public static string Tag(string productName, string featureName) { - return $"api/products/{productName}/features/{featureName}/tags/tag?api-version=3.0"; + return $"api/products/{productName}/features/{featureName}/tags/tag?api-version=5.0"; } } @@ -188,20 +188,20 @@ public static class Statistics { public static string Configuration() { - return $"api/statistics/configuration?api-version=3.0"; + return $"api/statistics/configuration?api-version=5.0"; } public static string Success() { - return $"api/statistics/success?api-version=3.0"; + return $"api/statistics/success?api-version=5.0"; } public static string Top() { - return $"api/statistics/top?api-version=3.0"; + return $"api/statistics/top?api-version=5.0"; } public static string Plot() { - return $"api/statistics/plot?api-version=3.0"; + return $"api/statistics/plot?api-version=5.0"; } } @@ -209,27 +209,27 @@ public static class Permissions { public static string My() { - return $"api/permissions/my?api-version=3.0"; + return $"api/permissions/my?api-version=5.0"; } public static string List(int pageIndex = 0, int pageCount = 1) { - return $"api/permissions?pageIndex={pageIndex}&pageCount={pageCount}&api-version=3.0"; + return $"api/permissions?pageIndex={pageIndex}&pageCount={pageCount}&api-version=5.0"; } public static string Add() { - return $"api/permissions?api-version=3.0"; + return $"api/permissions?api-version=5.0"; } public static string Delete(string subjectId) { - return $"api/permissions/{subjectId}?api-version=3.0"; + return $"api/permissions/{subjectId}?api-version=5.0"; } public static string Details(string subjectId) { - return $"api/permissions/{subjectId}?api-version=3.0"; + return $"api/permissions/{subjectId}?api-version=5.0"; } } } diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysControllerTests.cs index fe975ac9..41eda09a 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/ApiKeys/ApiKeysControllerTests.cs @@ -30,7 +30,7 @@ public apikeys_controller_should(ServerFixture serverFixture) public async Task get_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Get(name: "fooname")) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Get(name: "fooname")) .GetAsync(); response.StatusCode @@ -51,7 +51,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Get(name: "fooname")) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Get(name: "fooname")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -89,7 +89,7 @@ await _fixture.Given .AddApiKey(apiKey); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Get(apiKey.Name)) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Get(apiKey.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -124,7 +124,7 @@ await _fixture.Given .AddApiKey(apiKey); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Get(apiKey.Name)) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Get(apiKey.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -160,7 +160,7 @@ await _fixture.Given .AddApiKey(apiKey1, apiKey2); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.List()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -216,7 +216,7 @@ await _fixture.Given .AddApiKey(apiKey1, apiKey2); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.List(pageIndex: 1, pageCount: 1)) + .CreateRequest(ApiDefinitions.V5.ApiKeys.List(pageIndex: 1, pageCount: 1)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -256,7 +256,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.List()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -292,7 +292,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.List()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -327,7 +327,7 @@ await _fixture.Given .AddApiKey(apiKey1, apiKey2); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.List(pageIndex: 10, pageCount: 10)) + .CreateRequest(ApiDefinitions.V5.ApiKeys.List(pageIndex: 10, pageCount: 10)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -356,7 +356,7 @@ await _fixture.Given public async Task add_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Add()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Add()) .PostAsync(); response.StatusCode @@ -382,7 +382,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Add()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addApiKeyRequest); @@ -408,7 +408,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Add()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addApiKeyRequest); @@ -435,7 +435,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Add()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addApiKeyRequest); @@ -462,7 +462,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Add()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addApiKeyRequest); @@ -514,7 +514,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Add()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addApiKeyRequest); @@ -541,7 +541,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Add()) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addApiKeyRequest); @@ -565,7 +565,7 @@ await _fixture.Given public async Task delete_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Delete(name: "fooname")) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Delete(name: "fooname")) .DeleteAsync(); response.StatusCode @@ -585,7 +585,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Delete(name: "fooname")) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Delete(name: "fooname")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -620,7 +620,7 @@ await _fixture.Given .AddPermission(apikeyPermission, permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Delete(apiKey.Name)) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Delete(apiKey.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -649,7 +649,7 @@ await _fixture.Given .AddApiKey(apiKey); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.ApiKeys.Delete(apiKey.Name)) + .CreateRequest(ApiDefinitions.V5.ApiKeys.Delete(apiKey.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Audit/AuditControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Audit/AuditControllerTests.cs index c218ff77..c74618f6 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Audit/AuditControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Audit/AuditControllerTests.cs @@ -26,7 +26,7 @@ public audit_controller_should(ServerFixture serverFixture) public async Task list_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Audit.List()) + .CreateRequest(ApiDefinitions.V5.Audit.List()) .GetAsync(); response.StatusCode @@ -46,7 +46,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Audit.List()) + .CreateRequest(ApiDefinitions.V5.Audit.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -92,7 +92,7 @@ await _fixture.Given .AddHistory(history); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Audit.List()) + .CreateRequest(ApiDefinitions.V5.Audit.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -151,7 +151,7 @@ await _fixture.Given .AddHistory(history1,history2); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Audit.List(pageIndex:1,pageCount:1)) + .CreateRequest(ApiDefinitions.V5.Audit.List(pageIndex:1,pageCount:1)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Features/FeaturesControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Features/FeaturesControllerTests.cs index dfb599ff..608c400b 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Features/FeaturesControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Features/FeaturesControllerTests.cs @@ -33,7 +33,7 @@ public feature_controller_should(ServerFixture serverFixture) public async Task getstate_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.GetState(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.GetState(productName: "fooproduct", featureName: "barfeature")) .GetAsync(); response.StatusCode @@ -58,7 +58,7 @@ public async Task getstate_response_forbidden_when_user_request_is_not_authorize await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.GetState(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.GetState(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -103,7 +103,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.GetState(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.GetState(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -130,7 +130,7 @@ await _fixture.Given public async Task archive_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Archive(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Archive(productName: "fooproduct", featureName: "barfeature")) .PutAsync(); response.StatusCode @@ -156,7 +156,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Archive(product.Name, featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Archive(product.Name, featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -189,7 +189,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Archive(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Archive(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -223,7 +223,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Archive(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Archive(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -236,7 +236,7 @@ await _fixture.Given public async Task rollback_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(productName: "fooproduct", deploymentName: "Tests", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(productName: "fooproduct", deploymentName: "Tests", featureName: "barfeature")) .PutAsync(); response.StatusCode @@ -269,7 +269,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(product.Name, deployment.Name, featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(product.Name, deployment.Name, featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -308,7 +308,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -347,7 +347,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -386,7 +386,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -395,7 +395,7 @@ await _fixture.Given .Be(StatusCodes.Status204NoContent); response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -447,7 +447,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -485,7 +485,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollback(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollback(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -494,7 +494,7 @@ await _fixture.Given .Be(StatusCodes.Status204NoContent); response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.GetState(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.GetState(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -511,7 +511,7 @@ await _fixture.Given public async Task rollout_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(productName: "fooproduct", deploymentName: "deployment", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(productName: "fooproduct", deploymentName: "deployment", featureName: "barfeature")) .PutAsync(); response.StatusCode @@ -544,7 +544,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(product.Name, deployment.Name, featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(product.Name, deployment.Name, featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -583,7 +583,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -623,7 +623,7 @@ await _fixture.Given var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -632,7 +632,7 @@ await _fixture.Given .Be(StatusCodes.Status204NoContent); response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -671,7 +671,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -680,7 +680,7 @@ await _fixture.Given .Be(StatusCodes.Status204NoContent); response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.GetState(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.GetState(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -724,7 +724,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -777,7 +777,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Rollout(product.Name, deployment.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Rollout(product.Name, deployment.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsync(); @@ -797,7 +797,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Delete(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Delete(productName: "fooproduct", featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -835,7 +835,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Delete(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Delete(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -867,7 +867,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Delete(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Delete(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -880,7 +880,7 @@ await _fixture.Given public async Task delete_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Delete(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Delete(productName: "fooproduct", featureName: "barfeature")) .DeleteAsync(); response.StatusCode @@ -906,7 +906,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Delete(product.Name, featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Delete(product.Name, featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -921,7 +921,7 @@ public async Task get_response_forbidden_if_user_is_not_authorized() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Get(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Get(productName: "fooproduct", featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -970,7 +970,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Get(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Get(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1026,7 +1026,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Get(product.Name, "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Get(product.Name, "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1040,7 +1040,7 @@ await _fixture.Given public async Task get_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Get(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Get(productName: "fooproduct", featureName: "barfeature")) .GetAsync(); response.StatusCode @@ -1052,7 +1052,7 @@ public async Task get_response_unauthorized_when_user_request_is_not_authenticat public async Task list_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.List(productName: "fooproduct")) + .CreateRequest(ApiDefinitions.V5.Features.List(productName: "fooproduct")) .GetAsync(); response.StatusCode @@ -1093,7 +1093,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.List(product.Name)) + .CreateRequest(ApiDefinitions.V5.Features.List(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1156,7 +1156,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.List(product.Name)) + .CreateRequest(ApiDefinitions.V5.Features.List(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1214,7 +1214,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.List(product.Name, pageIndex: 1, pageCount: 1)) + .CreateRequest(ApiDefinitions.V5.Features.List(product.Name, pageIndex: 1, pageCount: 1)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1272,7 +1272,7 @@ await _fixture.Given var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.List(product.Name)) + .CreateRequest(ApiDefinitions.V5.Features.List(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1332,7 +1332,7 @@ await _fixture.Given var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.List(product.Name)) + .CreateRequest(ApiDefinitions.V5.Features.List(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1373,7 +1373,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.List(product.Name, pageIndex: 10, pageCount: 10)) + .CreateRequest(ApiDefinitions.V5.Features.List(product.Name, pageIndex: 10, pageCount: 10)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1402,7 +1402,7 @@ await _fixture.Given public async Task update_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Update(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Update(productName: "fooproduct", featureName: "barfeature")) .PutAsync(); response.StatusCode @@ -1428,7 +1428,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Update(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Update(productName: "fooproduct", featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(updateFeatureRequest); @@ -1455,7 +1455,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Update(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Update(productName: "fooproduct", featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(updateFeatureRequest); @@ -1481,7 +1481,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Update(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Features.Update(productName: "fooproduct", featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(updateFeatureRequest); @@ -1521,7 +1521,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Update(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Update(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(updateFeatureRequest); @@ -1534,7 +1534,7 @@ await _fixture.Given public async Task add_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(productName: "fooproduct")) + .CreateRequest(ApiDefinitions.V5.Features.Add(productName: "fooproduct")) .PostAsync(); response.StatusCode @@ -1560,7 +1560,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(productName: "fooproduct")) + .CreateRequest(ApiDefinitions.V5.Features.Add(productName: "fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addFeatureRequest); @@ -1587,7 +1587,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(productName: "fooproduct")) + .CreateRequest(ApiDefinitions.V5.Features.Add(productName: "fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addFeatureRequest); @@ -1614,7 +1614,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(productName: "fooproduct")) + .CreateRequest(ApiDefinitions.V5.Features.Add(productName: "fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addFeatureRequest); @@ -1655,7 +1655,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(product.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Add(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addFeatureRequest); @@ -1700,7 +1700,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(product2.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Add(product2.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addFeatureRequest); @@ -1734,7 +1734,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(product.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Add(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addFeatureRequest); @@ -1768,7 +1768,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Features.Add(product.Name)) + .CreateRequest(ApiDefinitions.V5.Features.Add(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(addFeatureRequest); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Permissions/PermissionsControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Permissions/PermissionsControllerTests.cs index a4422466..3d1099b2 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Permissions/PermissionsControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Permissions/PermissionsControllerTests.cs @@ -32,7 +32,7 @@ public users_controller_should(ServerFixture serverFixture) public async Task my_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.My()) + .CreateRequest(ApiDefinitions.V5.Permissions.My()) .GetAsync(); response.StatusCode @@ -45,7 +45,7 @@ public async Task my_response_unauthorized_when_user_request_is_not_authenticate public async Task my_response_forbidden_when_user_request_is_authenticated_but_user_does_not_have_permissions() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.My()) + .CreateRequest(ApiDefinitions.V5.Permissions.My()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -66,7 +66,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.My()) + .CreateRequest(ApiDefinitions.V5.Permissions.My()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -86,7 +86,7 @@ await _fixture.Given public async Task list_response_unauthorized_if_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.List()) + .CreateRequest(ApiDefinitions.V5.Permissions.List()) .GetAsync(); response.StatusCode @@ -98,7 +98,7 @@ public async Task list_response_unauthorized_if_user_is_not_authenticated() public async Task details_response_unauthorized_if_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Details("some-subject-id")) + .CreateRequest(ApiDefinitions.V5.Permissions.Details("some-subject-id")) .GetAsync(); response.StatusCode @@ -118,7 +118,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Details("some-subject-id")) + .CreateRequest(ApiDefinitions.V5.Permissions.Details("some-subject-id")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -141,7 +141,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Details(subjectId)) + .CreateRequest(ApiDefinitions.V5.Permissions.Details(subjectId)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -164,7 +164,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Details(subjectId)) + .CreateRequest(ApiDefinitions.V5.Permissions.Details(subjectId)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -185,7 +185,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Details(permission.SubjectId)) + .CreateRequest(ApiDefinitions.V5.Permissions.Details(permission.SubjectId)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -207,7 +207,7 @@ await _fixture.Given public async Task delete_response_unauthorized_if_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Delete("some-subjectid")) + .CreateRequest(ApiDefinitions.V5.Permissions.Delete("some-subjectid")) .DeleteAsync(); response.StatusCode @@ -227,7 +227,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Delete("some-subjectid")) + .CreateRequest(ApiDefinitions.V5.Permissions.Delete("some-subjectid")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -250,7 +250,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Delete(subjectId)) + .CreateRequest(ApiDefinitions.V5.Permissions.Delete(subjectId)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -273,7 +273,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Delete(subjectId)) + .CreateRequest(ApiDefinitions.V5.Permissions.Delete(subjectId)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -294,7 +294,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Delete(permission.SubjectId)) + .CreateRequest(ApiDefinitions.V5.Permissions.Delete(permission.SubjectId)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -315,7 +315,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.List()) + .CreateRequest(ApiDefinitions.V5.Permissions.List()) .GetAsync(); response.StatusCode @@ -335,7 +335,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.List(pageCount: -1)) + .CreateRequest(ApiDefinitions.V5.Permissions.List(pageCount: -1)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -356,7 +356,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.List(pageCount: 0)) + .CreateRequest(ApiDefinitions.V5.Permissions.List(pageCount: 0)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -377,7 +377,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.List(pageIndex: -1)) + .CreateRequest(ApiDefinitions.V5.Permissions.List(pageIndex: -1)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -398,7 +398,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.List(pageIndex: 0, pageCount: 10)) + .CreateRequest(ApiDefinitions.V5.Permissions.List(pageIndex: 0, pageCount: 10)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -436,7 +436,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.List()) + .CreateRequest(ApiDefinitions.V5.Permissions.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -466,7 +466,7 @@ await _fixture.Given public async Task add_response_unauthorized_if_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Add()) + .CreateRequest(ApiDefinitions.V5.Permissions.Add()) .PostAsJsonAsync(new AddPermissionRequest()); response.StatusCode @@ -486,7 +486,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Add()) + .CreateRequest(ApiDefinitions.V5.Permissions.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new AddPermissionRequest()); @@ -507,7 +507,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Add()) + .CreateRequest(ApiDefinitions.V5.Permissions.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new AddPermissionRequest() { @@ -534,7 +534,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Add()) + .CreateRequest(ApiDefinitions.V5.Permissions.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(new UpdatePermissionRequest()); @@ -547,7 +547,7 @@ await _fixture.Given public async Task update_response_unauthorized_if_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Add()) + .CreateRequest(ApiDefinitions.V5.Permissions.Add()) .PostAsJsonAsync(new UpdatePermissionRequest()); response.StatusCode @@ -579,7 +579,7 @@ await _fixture.Given .AddPermission(requesterPermission, existingPermission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.Add()) + .CreateRequest(ApiDefinitions.V5.Permissions.Add()) .WithIdentity(requesterIdentity) .PutAsJsonAsync(new AddPermissionRequest() { diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Products/ProductControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Products/ProductControllerTests.cs index 3ae766a7..0d433594 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Products/ProductControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Products/ProductControllerTests.cs @@ -42,7 +42,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Import()) + .CreateRequest(ApiDefinitions.V5.Product.Import()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new ImportProductRequest() { @@ -58,7 +58,7 @@ await _fixture.Given public async Task importproduct_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Import()) + .CreateRequest(ApiDefinitions.V5.Product.Import()) .PostAsync(); response.StatusCode @@ -85,7 +85,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Import()) + .CreateRequest(ApiDefinitions.V5.Product.Import()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new ImportProductRequest() { @@ -116,7 +116,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Import()) + .CreateRequest(ApiDefinitions.V5.Product.Import()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new ImportProductRequest() { @@ -132,7 +132,7 @@ await _fixture.Given public async Task exportproduct_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Export("productname")) + .CreateRequest(ApiDefinitions.V5.Product.Export("productname")) .GetAsync(); response.StatusCode @@ -152,7 +152,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Export("productname")) + .CreateRequest(ApiDefinitions.V5.Product.Export("productname")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -180,7 +180,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Export("fooproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Export("fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -196,7 +196,7 @@ await _fixture.Given public async Task deletedeployment_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.DeleteDeployment("productname", "deploymentName")) + .CreateRequest(ApiDefinitions.V5.Product.DeleteDeployment("productname", "deploymentName")) .DeleteAsync(); response.StatusCode @@ -216,7 +216,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.DeleteDeployment("productname", "deploymentName")) + .CreateRequest(ApiDefinitions.V5.Product.DeleteDeployment("productname", "deploymentName")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -237,7 +237,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.DeleteDeployment("fooproduct", "barring")) + .CreateRequest(ApiDefinitions.V5.Product.DeleteDeployment("fooproduct", "barring")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -265,7 +265,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.DeleteDeployment(product.Name, "barring")) + .CreateRequest(ApiDefinitions.V5.Product.DeleteDeployment(product.Name, "barring")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -293,7 +293,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.DeleteDeployment(product.Name, EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) + .CreateRequest(ApiDefinitions.V5.Product.DeleteDeployment(product.Name, EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -329,7 +329,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.DeleteDeployment(product.Name, deployment.Name)) + .CreateRequest(ApiDefinitions.V5.Product.DeleteDeployment(product.Name, deployment.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -342,7 +342,7 @@ await _fixture.Given public async Task adddeployment_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.AddDeployment("productname")) + .CreateRequest(ApiDefinitions.V5.Product.AddDeployment("productname")) .PostAsync(); response.StatusCode @@ -362,7 +362,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.AddDeployment("productname")) + .CreateRequest(ApiDefinitions.V5.Product.AddDeployment("productname")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsync(); @@ -390,7 +390,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.AddDeployment(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.AddDeployment(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new AddDeploymentRequest() { @@ -421,7 +421,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.AddDeployment(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.AddDeployment(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new AddDeploymentRequest() { @@ -452,7 +452,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.AddDeployment(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.AddDeployment(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new AddDeploymentRequest() { @@ -483,7 +483,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.AddDeployment(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.AddDeployment(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(new AddDeploymentRequest() { @@ -500,7 +500,7 @@ await _fixture.Given public async Task list_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.List()) + .CreateRequest(ApiDefinitions.V5.Product.List()) .GetAsync(); response.StatusCode @@ -527,7 +527,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.List()) + .CreateRequest(ApiDefinitions.V5.Product.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -576,7 +576,7 @@ await _fixture.Given .AddProduct(product1, product2); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.List(pageIndex: 1, pageCount: 1)) + .CreateRequest(ApiDefinitions.V5.Product.List(pageIndex: 1, pageCount: 1)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -613,7 +613,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.List()) + .CreateRequest(ApiDefinitions.V5.Product.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -643,7 +643,7 @@ await _fixture.Given public async Task list_response_forbiden_when_user_is_authenticated_but_not_authorized() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.List()) + .CreateRequest(ApiDefinitions.V5.Product.List()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -672,7 +672,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.List(pageIndex: 10, pageCount: 10)) + .CreateRequest(ApiDefinitions.V5.Product.List(pageIndex: 10, pageCount: 10)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -701,7 +701,7 @@ await _fixture.Given public async Task add_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .PostAsync(); response.StatusCode @@ -734,7 +734,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -761,7 +761,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -788,7 +788,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -815,7 +815,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -842,7 +842,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -869,7 +869,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -897,7 +897,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -924,7 +924,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -952,7 +952,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -979,7 +979,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Add()) + .CreateRequest(ApiDefinitions.V5.Product.Add()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(productRequest); @@ -992,7 +992,7 @@ await _fixture.Given public async Task get_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Get("product")) + .CreateRequest(ApiDefinitions.V5.Product.Get("product")) .GetAsync(); response.StatusCode @@ -1012,7 +1012,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Get("product")) + .CreateRequest(ApiDefinitions.V5.Product.Get("product")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1040,7 +1040,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Get(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.Get(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1060,7 +1060,7 @@ await _fixture.Given public async Task get_response_forbidden_if_user_is_not_authorized() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Get("product")) + .CreateRequest(ApiDefinitions.V5.Product.Get("product")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -1073,7 +1073,7 @@ public async Task get_response_forbidden_if_user_is_not_authorized() public async Task delete_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Delete("product")) + .CreateRequest(ApiDefinitions.V5.Product.Delete("product")) .DeleteAsync(); response.StatusCode @@ -1093,7 +1093,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Delete("fooproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Delete("fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -1121,7 +1121,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Delete(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.Delete(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -1142,7 +1142,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Delete("fooproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Delete("fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -1200,7 +1200,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Delete(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.Delete(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -1213,7 +1213,7 @@ await _fixture.Given public async Task update_response_unauthorizaed_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Update("fooproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Update("fooproduct")) .PutAsync(); response.StatusCode @@ -1240,7 +1240,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Update("barproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Update("barproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(request); @@ -1265,7 +1265,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Update("fooproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Update("fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(request); @@ -1283,7 +1283,7 @@ public async Task update_response_bad_request_if_product_name_is_greater_than_20 }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Update("fooproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Update("fooproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(request); @@ -1310,7 +1310,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Update("barproduct")) + .CreateRequest(ApiDefinitions.V5.Product.Update("barproduct")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(request); @@ -1344,7 +1344,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Update(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.Update(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(request); @@ -1378,7 +1378,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Product.Update(product.Name)) + .CreateRequest(ApiDefinitions.V5.Product.Update(product.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PutAsJsonAsync(request); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Statistics/StatisticsControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Statistics/StatisticsControllerTests.cs index 46a5f7bb..ff9a09d8 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Statistics/StatisticsControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Statistics/StatisticsControllerTests.cs @@ -31,7 +31,7 @@ public statistics_controller_should(ServerFixture serverFixture) public async Task get_configuration_statistics_response_unauthorized_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Statistics.Configuration()) + .CreateRequest(ApiDefinitions.V5.Statistics.Configuration()) .GetAsync(); response.StatusCode @@ -76,7 +76,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Statistics.Configuration()) + .CreateRequest(ApiDefinitions.V5.Statistics.Configuration()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -105,7 +105,7 @@ await _fixture.Given public async Task get_success_statistics_response_unauthorized_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Statistics.Success()) + .CreateRequest(ApiDefinitions.V5.Statistics.Success()) .GetAsync(); response.StatusCode @@ -126,7 +126,7 @@ await _fixture.Given var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Statistics.Success()) + .CreateRequest(ApiDefinitions.V5.Statistics.Success()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -153,7 +153,7 @@ await _fixture.Given await _fixture.Given.AddMetric(SampleMetrics()); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Statistics.Success()) + .CreateRequest(ApiDefinitions.V5.Statistics.Success()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -180,7 +180,7 @@ await _fixture.Given await _fixture.Given.AddMetric(SampleMetrics()); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Statistics.Top()) + .CreateRequest(ApiDefinitions.V5.Statistics.Top()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -209,7 +209,7 @@ await _fixture.Given await _fixture.Given.AddMetric(SampleMetrics()); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Statistics.Plot()) + .CreateRequest(ApiDefinitions.V5.Statistics.Plot()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Store/ConfigurationControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Store/ConfigurationControllerTests.cs index 9cc650e5..cd6eb9a9 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Store/ConfigurationControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Store/ConfigurationControllerTests.cs @@ -27,7 +27,7 @@ public store_controller_should(ServerFixture serverFixture) public async Task response_unauthorized_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) + .CreateRequest(ApiDefinitions.V5.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) .GetAsync(); response.StatusCode @@ -84,7 +84,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) + .CreateRequest(ApiDefinitions.V5.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -169,7 +169,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) + .CreateRequest(ApiDefinitions.V5.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: EsquioConstants.DEFAULT_DEPLOYMENT_NAME)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -271,7 +271,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: productionDeployment.Name)) + .CreateRequest(ApiDefinitions.V5.Configuration.Get(productName: "fooproduct", featureName: "barfeature", deployment: productionDeployment.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Tags/TagsControllerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Tags/TagsControllerTests.cs index d7fa60ee..62750c5d 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Tags/TagsControllerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Tags/TagsControllerTests.cs @@ -27,7 +27,7 @@ public tags_controller_should(ServerFixture serverFixture) public async Task not_allow_to_untag_features_when_user_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Untag(productName: "fooproduct", featureName: "barfeature", tag: "peformance")) + .CreateRequest(ApiDefinitions.V5.Tags.Untag(productName: "fooproduct", featureName: "barfeature", tag: "peformance")) .DeleteAsync(); response.StatusCode @@ -72,7 +72,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Untag(product.Name, feature.Name, tag.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.Untag(product.Name, feature.Name, tag.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -110,7 +110,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Untag(product.Name, feature.Name, tag: "performance")) + .CreateRequest(ApiDefinitions.V5.Tags.Untag(product.Name, feature.Name, tag: "performance")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -152,7 +152,7 @@ await _fixture.Given var request = new AddTagRequest(tag); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Tag(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.Tag(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(request); @@ -194,7 +194,7 @@ await _fixture.Given var request = new AddTagRequest(tag); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Tag(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.Tag(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(request); @@ -236,7 +236,7 @@ await _fixture.Given var request = new AddTagRequest(tag,"#FF0022"); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Tag(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.Tag(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(request); @@ -279,7 +279,7 @@ await _fixture.Given var request = new AddTagRequest(tag, "#nonvalid"); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Tag(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.Tag(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(request); @@ -329,7 +329,7 @@ await _fixture.Given var request = new AddTagRequest("performance"); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Tag(product.Name, feature2.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.Tag(product.Name, feature2.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(request); @@ -353,7 +353,7 @@ await _fixture.Given var request = new AddTagRequest(tag); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Tag(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Tags.Tag(productName: "fooproduct", featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(request); @@ -402,7 +402,7 @@ await _fixture.Given var request = new AddTagRequest(tag.Name); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.Tag(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.Tag(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(request); @@ -460,7 +460,7 @@ await _fixture.Given await _fixture.Given.AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.List(product.Name, feature.Name)) + .CreateRequest(ApiDefinitions.V5.Tags.List(product.Name, feature.Name)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -478,7 +478,7 @@ await _fixture.Given public async Task get_response_forbidden_if_user_is_unauthorized() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Tags.List(productName: "fooproduct", featureName: "barfeature")) + .CreateRequest(ApiDefinitions.V5.Tags.List(productName: "fooproduct", featureName: "barfeature")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Toggles/ToggleControlerTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Toggles/ToggleControlerTests.cs index a8207e31..24944040 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Toggles/ToggleControlerTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Toggles/ToggleControlerTests.cs @@ -34,7 +34,7 @@ public toggles_controller_should(ServerFixture serverFixture) public async Task get_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Get(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) + .CreateRequest(ApiDefinitions.V5.Toggles.Get(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) .GetAsync(); response.StatusCode @@ -68,7 +68,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Get(productName: product.Name, featureName: feature.Name, toggleType: "non-existing-toggle")) + .CreateRequest(ApiDefinitions.V5.Toggles.Get(productName: product.Name, featureName: feature.Name, toggleType: "non-existing-toggle")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -127,7 +127,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Get(product.Name, feature.Name, toggle.Type)) + .CreateRequest(ApiDefinitions.V5.Toggles.Get(product.Name, feature.Name, toggle.Type)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -194,7 +194,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Get(product.Name, feature.Name, toggle.Type)) + .CreateRequest(ApiDefinitions.V5.Toggles.Get(product.Name, feature.Name, toggle.Type)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -207,7 +207,7 @@ await _fixture.Given public async Task get_response_forbidden_if_user_is_not_authorized() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Get(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) + .CreateRequest(ApiDefinitions.V5.Toggles.Get(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -220,7 +220,7 @@ public async Task get_response_forbidden_if_user_is_not_authorized() public async Task delete_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Delete(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) + .CreateRequest(ApiDefinitions.V5.Toggles.Delete(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) .DeleteAsync(); response.StatusCode @@ -240,7 +240,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Delete(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) + .CreateRequest(ApiDefinitions.V5.Toggles.Delete(productName: "fooproduct", featureName: "barfeature", toggleType: "type")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -275,7 +275,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Delete(product.Name, feature.Name, "non-existing")) + .CreateRequest(ApiDefinitions.V5.Toggles.Delete(product.Name, feature.Name, "non-existing")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -334,7 +334,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Delete(product.Name, feature.Name, toggle.Type)) + .CreateRequest(ApiDefinitions.V5.Toggles.Delete(product.Name, feature.Name, toggle.Type)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -403,7 +403,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Delete(product.Name, feature.Name, togglebar.Type)) + .CreateRequest(ApiDefinitions.V5.Toggles.Delete(product.Name, feature.Name, togglebar.Type)) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .DeleteAsync(); @@ -416,7 +416,7 @@ await _fixture.Given public async Task reveal_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Reveal("Esquio.Toggles.FromToToggle")) + .CreateRequest(ApiDefinitions.V5.Toggles.Reveal("Esquio.Toggles.FromToToggle")) .GetAsync(); response.StatusCode @@ -437,7 +437,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Reveal("Esquio.Toggles.NonExisting")) + .CreateRequest(ApiDefinitions.V5.Toggles.Reveal("Esquio.Toggles.NonExisting")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -502,7 +502,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Reveal("Esquio.Toggles.EnvironmentVariableToggle,Esquio")) + .CreateRequest(ApiDefinitions.V5.Toggles.Reveal("Esquio.Toggles.EnvironmentVariableToggle,Esquio")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -576,7 +576,7 @@ await _fixture.Given .AddProduct(product); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Reveal("Esquio.Toggles.EnvironmentToggle")) + .CreateRequest(ApiDefinitions.V5.Toggles.Reveal("Esquio.Toggles.EnvironmentToggle")) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -589,7 +589,7 @@ await _fixture.Given public async Task knowntypes_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.KnownTypes()) + .CreateRequest(ApiDefinitions.V5.Toggles.KnownTypes()) .GetAsync(); response.StatusCode @@ -602,7 +602,7 @@ public async Task knowntypes_response_unauthorized_when_user_request_is_not_auth public async Task knowntypes_response_forbidden_if_user_is_not_authorize() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.KnownTypes()) + .CreateRequest(ApiDefinitions.V5.Toggles.KnownTypes()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -623,7 +623,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.KnownTypes()) + .CreateRequest(ApiDefinitions.V5.Toggles.KnownTypes()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -665,7 +665,7 @@ await _fixture.Given public async Task add_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Post()) + .CreateRequest(ApiDefinitions.V5.Toggles.Post()) .PostAsync(); response.StatusCode @@ -718,7 +718,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Post()) + .CreateRequest(ApiDefinitions.V5.Toggles.Post()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(body); @@ -786,7 +786,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Post()) + .CreateRequest(ApiDefinitions.V5.Toggles.Post()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(body); @@ -844,7 +844,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Post()) + .CreateRequest(ApiDefinitions.V5.Toggles.Post()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(body); @@ -903,7 +903,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.Post()) + .CreateRequest(ApiDefinitions.V5.Toggles.Post()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(body); @@ -916,7 +916,7 @@ await _fixture.Given public async Task addparameter_response_unauthorized_when_user_request_is_not_authenticated() { var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .PostAsync(); response.StatusCode @@ -945,7 +945,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -975,7 +975,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1005,7 +1005,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1035,7 +1035,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1066,7 +1066,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1126,7 +1126,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1194,7 +1194,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1254,7 +1254,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1331,7 +1331,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); @@ -1361,7 +1361,7 @@ await _fixture.Given }; var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Toggles.PostParameter()) + .CreateRequest(ApiDefinitions.V5.Toggles.PostParameter()) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .PostAsJsonAsync(parameterToggleRequest); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs index 5671851f..80a8e9a8 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs @@ -31,7 +31,7 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.My()) + .CreateRequest(ApiDefinitions.V5.Permissions.My()) .AddHeader("X-API-VERSION", "X.X") .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); @@ -53,8 +53,8 @@ await _fixture.Given .AddPermission(permission); var response = await _fixture.TestServer - .CreateRequest(ApiDefinitions.V3.Permissions.My()) - .AddHeader("X-API-VERSION", "3.0") + .CreateRequest(ApiDefinitions.V5.Permissions.My()) + .AddHeader("X-API-VERSION", "5.0") .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); From b558488f3171205a6ff05bcd00203249d746f1e7 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Thu, 15 Oct 2020 19:12:43 +0200 Subject: [PATCH 03/15] Working migration blazor getting started --- ...ngStarted.Blazor.WebAssembly.Client.csproj | 6 +- .../Client/Pages/FetchData.razor | 73 ++++----- .../Client/Program.cs | 5 +- .../Client/Shared/MainLayout.razor | 20 +-- .../Client/Shared/MainLayout.razor.css | 70 +++++++++ .../Client/Shared/NavMenu.razor | 2 +- .../Client/Shared/NavMenu.razor.css | 62 ++++++++ .../Client/Shared/SurveyPrompt.razor | 2 +- .../Client/_Imports.razor | 6 +- .../Client/wwwroot/css/app.css | 143 +----------------- .../Client/wwwroot/favicon.ico | Bin 32038 -> 5430 bytes .../Client/wwwroot/index.html | 7 +- .../Server/Pages/Shared/_Layout.cshtml | 20 --- .../Server/Startup.cs | 9 +- .../Server/appsettings.json | 2 +- .../ServiceCollectionExtensions.cs | 4 +- src/Esquio.UI.Client/Esquio.UI.Client.csproj | 3 +- src/Esquio.UI.Client/Program.cs | 61 -------- tests/FunctionalTests/Constants.cs | 1 + .../Esquio.Http.Store/EsquioHttpStoreTests.cs | 4 +- .../Scenarios/Versioning/VersioningTests.cs | 2 +- 21 files changed, 204 insertions(+), 298 deletions(-) create mode 100644 samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor.css create mode 100644 samples/GettingStarted.Blazor.WebAssembly/Client/Shared/NavMenu.razor.css delete mode 100644 samples/GettingStarted.Blazor.WebAssembly/Server/Pages/Shared/_Layout.cshtml diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj b/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj index 89144ece..3065eca3 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/GettingStarted.Blazor.WebAssembly.Client.csproj @@ -1,13 +1,11 @@ - + $(NetFrameworkVersion) - $(RazorLangVersion) - - + diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor b/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor index b288a9ad..63cce544 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor @@ -1,4 +1,4 @@ -@page "/fetchdata" +@page "/fetchdata" @using GettingStarted.Blazor.WebAssembly.Shared @inject HttpClient Http @@ -6,49 +6,34 @@

This component demonstrates fetching data from the server.

- - -

LOADING

-
- - @if (forecasts == null) - { -

Loading...

- } - else - { - - - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
- - - } -
-

HidenGem is not enabled!

-
- - - +@if (forecasts == null) +{ +

Loading...

+} +else +{ + + + + + + + + + + + @foreach (var forecast in forecasts) + { + + + + + + + } + +
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
+} @code { private WeatherForecast[] forecasts; diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/Program.cs b/samples/GettingStarted.Blazor.WebAssembly/Client/Program.cs index 52a92045..4e2fc8bc 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/Program.cs +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/Program.cs @@ -11,11 +11,10 @@ public class Program public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); - builder.RootComponents.Add("app"); + builder.RootComponents.Add("#app"); - builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); + builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddEsquioClient(); //add esquio client endpoint to asp.net core host app - await builder.Build().RunAsync(); } } diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor b/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor index bff635f3..b0600db1 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor @@ -1,15 +1,17 @@ @inherits LayoutComponentBase - - -
-
- About +
+ -
- @Body +
+
+ About +
+ +
+ @Body +
diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor.css b/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor.css new file mode 100644 index 00000000..5c663e0a --- /dev/null +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/MainLayout.razor.css @@ -0,0 +1,70 @@ +.page { + position: relative; + display: flex; + flex-direction: column; +} + +.main { + flex: 1; +} + +.sidebar { + background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); +} + +.top-row { + background-color: #f7f7f7; + border-bottom: 1px solid #d6d5d5; + justify-content: flex-end; + height: 3.5rem; + display: flex; + align-items: center; +} + + .top-row ::deep a, .top-row .btn-link { + white-space: nowrap; + margin-left: 1.5rem; + } + + .top-row a:first-child { + overflow: hidden; + text-overflow: ellipsis; + } + +@media (max-width: 640.98px) { + .top-row:not(.auth) { + display: none; + } + + .top-row.auth { + justify-content: space-between; + } + + .top-row a, .top-row .btn-link { + margin-left: 0; + } +} + +@media (min-width: 641px) { + .page { + flex-direction: row; + } + + .sidebar { + width: 250px; + height: 100vh; + position: sticky; + top: 0; + } + + .top-row { + position: sticky; + top: 0; + z-index: 1; + } + + .main > div { + padding-left: 2rem !important; + padding-right: 1.5rem !important; + } +} diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/NavMenu.razor b/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/NavMenu.razor index bfc956ea..cd56d90e 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/NavMenu.razor +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/Shared/NavMenu.razor @@ -1,5 +1,5 @@  diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/_Imports.razor b/samples/GettingStarted.Blazor.WebAssembly/Client/_Imports.razor index e05f24eb..39dd6472 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/_Imports.razor +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/_Imports.razor @@ -3,8 +3,10 @@ @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.AspNetCore.Components.WebAssembly.Http @using Microsoft.JSInterop @using GettingStarted.Blazor.WebAssembly.Client @using GettingStarted.Blazor.WebAssembly.Client.Shared - -@using Esquio.Blazor.WebAssembly +@using GettingStarted.Blazor.WebAssembly.Shared + \ No newline at end of file diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/wwwroot/css/app.css b/samples/GettingStarted.Blazor.WebAssembly/Client/wwwroot/css/app.css index 0f057c2e..8beedfdf 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/wwwroot/css/app.css +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/wwwroot/css/app.css @@ -14,97 +14,10 @@ a, .btn-link { border-color: #1861ac; } -app { - position: relative; - display: flex; - flex-direction: column; -} - -.top-row { - height: 3.5rem; - display: flex; - align-items: center; -} - -.main { - flex: 1; -} - - .main .top-row { - background-color: #f7f7f7; - border-bottom: 1px solid #d6d5d5; - justify-content: flex-end; - } - - .main .top-row > a, .main .top-row .btn-link { - white-space: nowrap; - margin-left: 1.5rem; - } - -.main .top-row a:first-child { - overflow: hidden; - text-overflow: ellipsis; -} - -.sidebar { - background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); -} - - .sidebar .top-row { - background-color: rgba(0,0,0,0.4); - } - - .sidebar .navbar-brand { - font-size: 1.1rem; - } - - .sidebar .oi { - width: 2rem; - font-size: 1.1rem; - vertical-align: text-top; - top: -2px; - } - - .sidebar .nav-item { - font-size: 0.9rem; - padding-bottom: 0.5rem; - } - - .sidebar .nav-item:first-of-type { - padding-top: 1rem; - } - - .sidebar .nav-item:last-of-type { - padding-bottom: 1rem; - } - - .sidebar .nav-item a { - color: #d7d7d7; - border-radius: 4px; - height: 3rem; - display: flex; - align-items: center; - line-height: 3rem; - } - - .sidebar .nav-item a.active { - background-color: rgba(255,255,255,0.25); - color: white; - } - - .sidebar .nav-item a:hover { - background-color: rgba(255,255,255,0.1); - color: white; - } - .content { padding-top: 1.1rem; } -.navbar-toggler { - background-color: rgba(255, 255, 255, 0.1); -} - .valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; } @@ -129,55 +42,9 @@ app { z-index: 1000; } -#blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; -} - -@media (max-width: 767.98px) { - .main .top-row:not(.auth) { - display: none; - } - - .main .top-row.auth { - justify-content: space-between; - } - - .main .top-row a, .main .top-row .btn-link { - margin-left: 0; - } -} - -@media (min-width: 768px) { - app { - flex-direction: row; - } - - .sidebar { - width: 250px; - height: 100vh; - position: sticky; - top: 0; - } - - .main .top-row { - position: sticky; - top: 0; - } - - .main > div { - padding-left: 2rem !important; - padding-right: 1.5rem !important; - } - - .navbar-toggler { - display: none; + #blazor-error-ui .dismiss { + cursor: pointer; + position: absolute; + right: 0.75rem; + top: 0.5rem; } - - .sidebar .collapse { - /* Never collapse the sidebar for wide screens */ - display: block; - } -} diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/wwwroot/favicon.ico b/samples/GettingStarted.Blazor.WebAssembly/Client/wwwroot/favicon.ico index a3a799985c43bc7309d701b2cad129023377dc71..63e859b476eff5055e0e557aaa151ca8223fbeef 100644 GIT binary patch delta 57 zcmZ4Xi*cKl8Uq6(0~3RS0*F>%SRuf`02E>n0Ma0S1`7kjIUsxUI+is88@<$6Cf^XT F0{{n`3U~kj literal 32038 zcmeHwX>eTEbtY7aYbrGrkNjgie?1jXjZ#zP%3n{}GObKv$BxI7Sl;Bwl5E+Qtj&t8 z*p|m4DO#HoJC-FyvNnp8NP<{Na0LMnTtO21(rBP}?EAiNjWgeO?z`{3ZoURUQlV2d zY1Pqv{m|X_oO91|?^z!6@@~od!@OH>&BN;>c@O+yUfy5w>LccTKJJ&`-k<%M^Zvi( z<$dKp=jCnNX5Qa+M_%6g|IEv~4R84q9|7E=|Ho(Wz3f-0wPjaRL;W*N^>q%^KGRr7 zxbjSORb_c&eO;oV_DZ7ua!sPH=0c+W;`vzJ#j~-x3uj};50#vqo*0w4!LUqs*UCh9 zvy2S%$#8$K4EOa&e@~aBS65_hc~Mpu=454VT2^KzWqEpBA=ME|O;1cn?8p<+{MKJf zbK#@1wzL44m$k(?85=Obido7=C|xWKe%66$z)NrzRwR>?hK?_bbwT z@Da?lBrBL}Zemo1@!9pYRau&!ld17h{f+UV0sY(R{ET$PBB|-=Nr@l-nY6w8HEAw* zRMIQU`24Jl_IFEPcS=_HdrOP5yf81z_?@M>83Vv65$QFr9nPg(wr`Ke8 zaY4ogdnMA*F7a4Q1_uXadTLUpCk;$ZPRRJ^sMOch;rlbvUGc1R9=u;dr9YANbQ<4Z z#P|Cp9BP$FXNPolgyr1XGt$^lFPF}rmBF5rj1Kh5%dforrP8W}_qJL$2qMBS-#%-|s#BPZBSETsn_EBYcr(W5dq( z@f%}C|iN7)YN`^)h7R?Cg}Do*w-!zwZb9=BMp%Wsh@nb22hA zA{`wa8Q;yz6S)zfo%sl08^GF`9csI9BlGnEy#0^Y3b);M+n<(}6jziM7nhe57a1rj zC@(2ISYBL^UtWChKzVWgf%4LW2Tqg_^7jMw`C$KvU+mcakFjV(BGAW9g%CzSyM;Df z143=mq0oxaK-H;o>F3~zJ<(3-j&?|QBn)WJfP#JR zRuA;`N?L83wQt78QIA$(Z)lGQY9r^SFal;LB^qi`8%8@y+mwcGsf~nv)bBy2S7z~9 z=;X@Gglk)^jpbNz?1;`!J3QUfAOp4U$Uxm5>92iT`mek#$>s`)M>;e4{#%HAAcb^8_Ax%ersk|}# z0bd;ZPu|2}18KtvmIo8`1@H~@2ejwo(5rFS`Z4&O{$$+ch2hC0=06Jh`@p+p8LZzY z&2M~8T6X^*X?yQ$3N5EzRv$(FtSxhW>>ABUyp!{484f8(%C1_y)3D%Qgfl_!sz`LTXOjR&L!zPA0qH_iNS!tY{!^2WfD%uT}P zI<~&?@&))5&hPPHVRl9);TPO>@UI2d!^ksb!$9T96V(F){puTsn(}qt_WXNw4VvHj zf;6A_XCvE`Z@}E-IOaG0rs>K>^=Sr&OgT_p;F@v0VCN0Y$r|Lw1?Wjt`AKK~RT*kJ z2>QPuVgLNcF+XKno;WBv$yj@d_WFJbl*#*V_Cwzo@%3n5%z4g21G*PVZ)wM5$A{klYozmGlB zT@u2+s}=f}25%IA!yNcXUr!!1)z(Nqbhojg0lv@7@0UlvUMT)*r;M$d0-t)Z?B1@qQk()o!4fqvfr_I0r7 zy1(NdkHEj#Yu{K>T#We#b#FD=c1XhS{hdTh9+8gy-vkcdkk*QS@y(xxEMb1w6z<^~ zYcETGfB#ibR#ql0EiD;PR$L&Vrh2uRv5t_$;NxC;>7_S5_OXxsi8udY3BUUdi55Sk zcyKM+PQ9YMA%D1kH1q48OFG(Gbl=FmV;yk8o>k%0$rJ8%-IYsHclnYuTskkaiCGkUlkMY~mx&K}XRlKIW;odWIeuKjtbc^8bBOTqK zjj(ot`_j?A6y_h%vxE9o*ntx#PGrnK7AljD_r58ylE*oy@{IY%+mA^!|2vW_`>`aC{#3`#3;D_$^S^cM zRcF+uTO2sICledvFgNMU@A%M)%8JbSLq{dD|2|2Sg8vvh_uV6*Q?F&rKaV{v_qz&y z`f;stIb?Cb2!Cg7CG91Bhu@D@RaIrq-+o+T2fwFu#|j>lD6ZS9-t^5cx>p|?flqUA z;Cgs#V)O#`Aw4$Kr)L5?|7f4izl!;n0jux}tEW$&&YBXz9o{+~HhoiYDJ`w5BVTl&ARya=M7zdy$FEe}iGBur8XE>rhLj&_yDk5D4n2GJZ07u7%zyAfNtOLn;)M?h*Py-Xtql5aJOtL4U8e|!t? z((sc6&OJXrPdVef^wZV&x=Z&~uA7^ix8rly^rEj?#d&~pQ{HN8Yq|fZ#*bXn-26P^ z5!)xRzYO9{u6vx5@q_{FE4#7BipS#{&J7*>y}lTyV94}dfE%Yk>@@pDe&F7J09(-0|wuI|$of-MRfK51#t@t2+U|*s=W; z!Y&t{dS%!4VEEi$efA!#<<7&04?kB}Soprd8*jYv;-Qj~h~4v>{XX~kjF+@Z7<t?^|i z#>_ag2i-CRAM8Ret^rZt*^K?`G|o>1o(mLkewxyA)38k93`<~4VFI?5VB!kBh%NNU zxb8K(^-MU1ImWQxG~nFB-Un;6n{lQz_FfsW9^H$Xcn{;+W^ZcG$0qLM#eNV=vGE@# z1~k&!h4@T|IiI<47@pS|i?Qcl=XZJL#$JKve;booMqDUYY{(xcdj6STDE=n?;fsS1 ze`h~Q{CT$K{+{t+#*I1=&&-UU8M&}AwAxD-rMa=e!{0gQXP@6azBq9(ji11uJF%@5 zCvV`#*?;ZguQ7o|nH%bm*s&jLej#@B35gy32ZAE0`Pz@#j6R&kN5w{O4~1rhDoU zEBdU)%Nl?8zi|DR((u|gg~r$aLYmGMyK%FO*qLvwxK5+cn*`;O`16c!&&XT{$j~5k zXb^fbh1GT-CI*Nj{-?r7HNg=e3E{6rxuluPXY z5Nm8ktc$o4-^SO0|Es_sp!A$8GVwOX+%)cH<;=u#R#nz;7QsHl;J@a{5NUAmAHq4D zIU5@jT!h?kUp|g~iN*!>jM6K!W5ar0v~fWrSHK@})@6Lh#h)C6F6@)&-+C3(zO! z8+kV|B7LctM3DpI*~EYo>vCj>_?x&H;>y0*vKwE0?vi$CLt zfSJB##P|M2dEUDBPKW=9cY-F;L;h3Fs4E2ERdN#NSL7ctAC z?-}_a{*L@GA7JHJudxtDVA{K5Yh*k(%#x4W7w+^ zcb-+ofbT5ieG+@QG2lx&7!MyE2JWDP@$k`M;0`*d+oQmJ2A^de!3c53HFcfW_Wtv< zKghQ;*FifmI}kE4dc@1y-u;@qs|V75Z^|Q0l0?teobTE8tGl@EB?k#q_wUjypJ*R zyEI=DJ^Z+d*&}B_xoWvs27LtH7972qqMxVFcX9}c&JbeNCXUZM0`nQIkf&C}&skSt z^9fw@b^Hb)!^hE2IJq~~GktG#ZWwWG<`@V&ckVR&r=JAO4YniJewVcG`HF;59}=bf zLyz0uxf6MhuSyH#-^!ZbHxYl^mmBVrx) zyrb8sQ*qBd_WXm9c~Of$&ZP$b^)<~0%nt#7y$1Jg$e}WCK>TeUB{P>|b1FAB?%K7>;XiOfd}JQ`|IP#Vf%kVy zXa4;XFZ+>n;F>uX&3|4zqWK2u3c<>q;tzjsb1;d{u;L$-hq3qe@82(ob<3qom#%`+ z;vzYAs7TIMl_O75BXu|r`Qhc4UT*vN$3Oo0kAC!{f2#HexDy|qUpgTF;k{o6|L>7l z=?`=*LXaow1o;oNNLXsGTrvC)$R&{m=94Tf+2iTT3Y_Or z-!;^0a{kyWtO4vksG_3cyc7HQ0~detf0+2+qxq(e1NS251N}w5iTSrM)`0p8rem!j zZ56hGD=pHI*B+dd)2B`%|9f0goozCSeXPw3 z+58k~sI02Yz#lOneJzYcG)EB0|F+ggC6D|B`6}d0khAK-gz7U3EGT|M_9$ZINqZjwf>P zJCZ=ogSoE`=yV5YXrcTQZx@Un(64*AlLiyxWnCJ9I<5Nc*eK6eV1Mk}ci0*NrJ=t| zCXuJG`#7GBbPceFtFEpl{(lTm`LX=B_!H+& z>$*Hf}}y zkt@nLXFG9%v**s{z&{H4e?aqp%&l#oU8lxUxk2o%K+?aAe6jLojA& z_|J0<-%u^<;NT*%4)n2-OdqfctSl6iCHE?W_Q2zpJken#_xUJlidzs249H=b#g z?}L4-Tnp6)t_5X?_$v)vz`s9@^BME2X@w<>sKZ3=B{%*B$T5Nj%6!-Hr;I!Scj`lH z&2dHFlOISwWJ&S2vf~@I4i~(0*T%OFiuX|eD*nd2utS4$1_JM?zmp>a#CsVy6Er^z zeNNZZDE?R3pM?>~e?H_N`C`hy%m4jb;6L#8=a7l>3eJS2LGgEUxsau-Yh9l~o7=Yh z2mYg3`m5*3Ik|lKQf~euzZlCWzaN&=vHuHtOwK!2@W6)hqq$Zm|7`Nmu%9^F6UH?+ z@2ii+=iJ;ZzhiUKu$QB()nKk3FooI>Jr_IjzY6=qxYy;&mvi7BlQ?t4kRjIhb|2q? zd^K~{-^cxjVSj?!Xs=Da5IHmFzRj!Kzh~b!?`P7c&T9s77VLYB?8_?F zauM^)p;qFG!9PHLfIsnt43UnmV?Wn?Ki7aXSosgq;f?MYUuSIYwOn(5vWhb{f%$pn z4ySN-z}_%7|B);A@PA5k*7kkdr4xZ@s{e9j+9w;*RFm;XPDQwx%~;8iBzSKTIGKO z{53ZZU*OLr@S5=k;?CM^i#zkxs3Sj%z0U`L%q`qM+tP zX$aL;*^g$7UyM2Go+_4A+f)IQcy^G$h2E zb?nT$XlgTEFJI8GN6NQf%-eVn9mPilRqUbT$pN-|;FEjq@Ao&TxpZg=mEgBHB zU@grU;&sfmqlO=6|G3sU;7t8rbK$?X0y_v9$^{X`m4jZ_BR|B|@?ZCLSPPEzz`w1n zP5nA;4(kQFKm%$enjkkBxM%Y}2si&d|62L)U(dCzCGn56HN+i#6|nV-TGIo0;W;`( zW-y=1KF4dp$$mC_|6}pbb>IHoKQeZajXQB>jVR?u`R>%l1o54?6NnS*arpVopdEF; zeC5J3*M0p`*8lif;!irrcjC?(uExejsi~>4wKYwstGY^N@KY}TujLx`S=Cu+T=!dx zKWlPm->I**E{A*q-Z^FFT5$G%7Ij0_*Mo4-y6~RmyTzUB&lfae(WZfO>um}mnsDXPEbau-!13!!xd!qh*{C)6&bz0j1I{>y$D-S)b*)JMCPk!=~KL&6Ngin0p6MCOxF2L_R9t8N!$2Wpced<#`y!F;w zKTi5V_kX&X09wAIJ#anfg9Dhn0s7(C6Nj3S-mVn(i|C6ZAVq0$hE)874co};g z^hR7pe4lU$P;*ggYc4o&UTQC%liCXooIfkI3TNaBV%t~FRr}yHu7kjQ2J*3;e%;iW zvDVCh8=G80KAeyhCuY2LjrC!Od1rvF7h}zszxGV)&!)6ChP5WAjv-zQAMNJIG!JHS zwl?pLxC-V5II#(hQ`l)ZAp&M0xd4%cxmco*MIk?{BD=BK`1vpc}D39|XlV z{c&0oGdDa~TL2FT4lh=~1NL5O-P~0?V2#ie`v^CnANfGUM!b4F=JkCwd7Q`c8Na2q zJGQQk^?6w}Vg9-{|2047((lAV84uN%sK!N2?V(!_1{{v6rdgZl56f0zDMQ+q)jKzzu^ztsVken;=DjAh6G`Cw`Q4G+BjS+n*=KI~^K{W=%t zbD-rN)O4|*Q~@<#@1Vx$E!0W9`B~IZeFn87sHMXD>$M%|Bh93rdGf1lKoX3K651t&nhsl= zXxG|%@8}Bbrlp_u#t*DZX<}_0Yb{A9*1Pd_)LtqNwy6xT4pZrOY{s?N4)pPwT(i#y zT%`lRi8U#Ken4fw>H+N`{f#FF?ZxFlLZg7z7#cr4X>id z{9kUD`d2=w_Zlb{^c`5IOxWCZ1k<0T1D1Z31IU0Q2edsZ1K0xv$pQVYq2KEp&#v#Z z?{m@Lin;*Str(C2sfF^L>{R3cjY`~#)m>Wm$Y|1fzeS0-$(Q^z@} zEO*vlb-^XK9>w&Ef^=Zzo-1AFSP#9zb~X5_+){$(eB4K z8gtW+nl{q+CTh+>v(gWrsP^DB*ge(~Q$AGxJ-eYc1isti%$%nM<_&Ev?%|??PK`$p z{f-PM{Ym8k<$$)(F9)tqzFJ?h&Dk@D?Dt{4CHKJWLs8$zy6+(R)pr@0ur)xY{=uXFFzH_> z-F^tN1y(2hG8V)GpDg%wW0Px_ep~nIjD~*HCSxDi0y`H!`V*~RHs^uQsb1*bK1qGpmd zB1m`Cjw0`nLBF2|umz+a#2X$c?Lj;M?Lj;MUp*d>7j~ayNAyj@SLpeH`)BgRH}byy zyQSat!;U{@O(<<2fp&oQkIy$z`_CQ-)O@RN;QD9T4y|wIJ^%U#(BF%=`i49}j!D-) zkOwPSJaG03SMkE~BzW}b_v>LA&y)EEYO6sbdnTX*$>UF|JhZ&^MSb4}Tgbne_4n+C zwI8U4i~PI>7a3{kVa8|))*%C0|K+bIbmV~a`|G#+`TU#g zXW;bWIcWsQi9c4X*RUDpIfyoPY)2bI-r9)xulm1CJDkQd6u+f)_N=w1ElgEBjprPF z3o?Ly0RVeY_{3~fPVckRMxe2lM8hj!B8F)JO z!`AP6>u>5Y&3o9t0QxBpNE=lJx#NyIbp1gD zzUYBIPYHIv9ngk-Zt~<)62^1Zs1LLYMh@_tP^I7EX-9)Ed0^@y{k65Gp0KRcTmMWw zU|+)qx{#q0SL+4q?Q`i0>COIIF8a0Cf&C`hbMj?LmG9K&iW-?PJt*u)38tTXAP>@R zZL6uH^!RYNq$p>PKz7f-zvg>OKXcZ8h!%Vo@{VUZp|+iUD_xb(N~G|6c#oQK^nHZU zKg#F6<)+`rf~k*Xjjye+syV{bwU2glMMMs-^ss4`bYaVroXzn`YQUd__UlZL_mLs z(vO}k!~(mi|L+(5&;>r<;|OHnbXBE78LruP;{yBxZ6y7K3)nMo-{6PCI7gQi6+rF_ zkPod!Z8n}q46ykrlQS|hVB(}(2Kf7BCZ>Vc;V>ccbk2~NGaf6wGQH@W9&?Zt3v(h*P4xDrN>ex7+jH*+Qg z%^jH$&+*!v{sQ!xkWN4+>|b}qGvEd6ANzgqoVy5Qfws}ef2QqF{iiR5{pT}PS&yjo z>lron#va-p=v;m>WB+XVz|o;UJFdjo5_!RRD|6W{4}A2a#bZv)gS_`b|KsSH)Sd_JIr%<%n06TX&t{&!H#{)?4W9hlJ`R1>FyugOh3=D_{einr zu(Wf`qTkvED+gEULO0I*Hs%f;&=`=X4;N8Ovf28x$A*11`dmfy2=$+PNqX>XcG`h% zJY&A6@&)*WT^rC(Caj}2+|X|6cICm5h0OK0cGB_!wEKFZJU)OQ+TZ1q2bTx9hxnq& z$9ee|f9|0M^)#E&Pr4)f?o&DMM4w>Ksb{hF(0|wh+5_{vPow{V%TFzU2za&gjttNi zIyR9qA56dX52Qbv2aY^g`U7R43-p`#sO1A=KS2aKgfR+Yu^bQ*i-qu z%0mP;Ap)B~zZgO9lG^`325gOf?iUHF{~7jyGC)3L(eL(SQ70VzR~wLN18tnx(Cz2~ zctBl1kI)wAe+cxWHw*NW-d;=pd+>+wd$a@GBju*wFvabSaPtHiT!o#QFC+wBVwYo3s=y;z1jM+M=Fj!FZM>UzpL-eZzOT( zhmZmEfWa=%KE#V3-ZK5#v!Hzd{zc^{ctF~- z>DT-U`}5!fk$aj24`#uGdB7r`>oX5tU|d*b|N3V1lXmv%MGrvE(dXG)^-J*LA>$LE z7kut4`zE)v{@Op|(|@i#c>tM!12FQh?}PfA0`Bp%=%*RiXVzLDXnXtE@4B)5uR}a> zbNU}q+712pIrM`k^odG8dKtG$zwHmQI^c}tfjx5?egx3!e%JRm_64e+>`Ra1IRfLb z1KQ`SxmH{cZfyVS5m(&`{V}Y4j6J{b17`h6KWqZ&hfc(oR zxM%w!$F(mKy05kY&lco3%zvLCxBW+t*rxO+i=qGMvobx0-<7`VUu)ka`){=ew+Ovt zg%52_{&UbkUA8aJPWsk)gYWV4`dnxI%s?7^fGpq{ZQuu=VH{-t7w~K%_E<8`zS;V- zKTho*>;UQQul^1GT^HCt@I-q?)&4!QDgBndn?3sNKYKCQFU4LGKJ$n@Je$&w9@E$X z^p@iJ(v&`1(tq~1zc>0Vow-KR&vm!GUzT?Eqgnc)leZ9p)-Z*C!zqb=-$XG0 z^!8RfuQs5s>Q~qcz92(a_Q+KH?C*vCTr~UdTiR`JGuNH8v(J|FTiSEcPrBpmHRtmd zI2Jng0J=bXK);YY^rM?jzn?~X-Pe`GbAy{D)Y6D&1GY-EBcy%Bq?bKh?A>DD9DD!p z?{q02wno2sraGUkZv5dx+J8)&K$)No43Zr(*S`FEdL!4C)}WE}vJd%{S6-3VUw>Wp z?Aasv`T0^%P$2vE?L+Qhj~qB~K%eW)xH(=b_jU}TLD&BP*Pc9hz@Z=e0nkpLkWl}> z_5J^i(9Z7$(XG9~I3sY)`OGZ#_L06+Dy4E>UstcP-rU@xJ$&rxvo!n1Ao`P~KLU-8 z{zDgN4-&A6N!kPSYbQ&7sLufi`YtE2uN$S?e&5n>Y4(q#|KP!cc1j)T^QrUXMPFaP z_SoYO8S8G}Z$?AL4`;pE?7J5K8yWqy23>cCT2{=-)+A$X^-I9=e!@J@A&-;Ufc)`H}c(VI&;0x zrrGv()5mjP%jXzS{^|29?bLNXS0bC%p!YXI!;O457rjCEEzMkGf~B3$T}dXBO23tP z+Ci>;5UoM?C@bU@f9G1^X3=ly&ZeFH<@|RnOG--A&)fd)AUgjw?%izq{p(KJ`EP0v z2mU)P!+3t@X14DA=E2RR-|p${GZ9ETX=d+kJRZL$nSa0daI@&oUUxnZg0xd_xu>Vz lzF#z5%kSKX?YLH3ll^(hI(_`L*t#Iva2Ede*Z;>H_ + - GettingStarted.Blazor.WebAssembly + Esquio + - Loading... +
Loading...
An unhandled error has occurred. diff --git a/samples/GettingStarted.Blazor.WebAssembly/Server/Pages/Shared/_Layout.cshtml b/samples/GettingStarted.Blazor.WebAssembly/Server/Pages/Shared/_Layout.cshtml deleted file mode 100644 index 37be440a..00000000 --- a/samples/GettingStarted.Blazor.WebAssembly/Server/Pages/Shared/_Layout.cshtml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - @ViewBag.Title - - - - - -
-
- @RenderBody() -
-
- - - diff --git a/samples/GettingStarted.Blazor.WebAssembly/Server/Startup.cs b/samples/GettingStarted.Blazor.WebAssembly/Server/Startup.cs index 4ff75057..8dfa9f3d 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Server/Startup.cs +++ b/samples/GettingStarted.Blazor.WebAssembly/Server/Startup.cs @@ -19,13 +19,13 @@ public Startup(IConfiguration configuration) // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { - services .AddEsquio() .AddAspNetCoreDefaultServices() - .AddConfigurationStore(Configuration) - .Services - .AddControllersWithViews(); + .AddConfigurationStore(Configuration); + + services.AddControllersWithViews(); + services.AddRazorPages(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -51,6 +51,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseEndpoints(endpoints => { + endpoints.MapRazorPages(); endpoints.MapControllers(); endpoints.MapEsquio(); endpoints.MapFallbackToFile("index.html"); diff --git a/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json b/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json index 9b9d661c..3d4ee6e5 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json +++ b/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json @@ -14,7 +14,7 @@ "Features": [ { "Name": "HiddenGem", - "Enabled": false, + "Enabled": true, "Toggles": [] } ] diff --git a/src/Esquio.Blazor.WebAssembly/DependencyInjection/ServiceCollectionExtensions.cs b/src/Esquio.Blazor.WebAssembly/DependencyInjection/ServiceCollectionExtensions.cs index d241c69d..173b078f 100644 --- a/src/Esquio.Blazor.WebAssembly/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/Esquio.Blazor.WebAssembly/DependencyInjection/ServiceCollectionExtensions.cs @@ -21,7 +21,7 @@ public static IServiceCollection AddEsquioClient(this IServiceCollection service return services .Configure(configure) - .AddSingleton(); + .AddScoped(); } /// @@ -35,7 +35,7 @@ public static IServiceCollection AddEsquioClient(this IServiceCollection service return services .Configure(_ => { }) - .AddSingleton(); + .AddScoped(); } } } diff --git a/src/Esquio.UI.Client/Esquio.UI.Client.csproj b/src/Esquio.UI.Client/Esquio.UI.Client.csproj index eb111d5d..e498eabe 100644 --- a/src/Esquio.UI.Client/Esquio.UI.Client.csproj +++ b/src/Esquio.UI.Client/Esquio.UI.Client.csproj @@ -1,4 +1,4 @@ - + $(NetFrameworkVersion) @@ -13,7 +13,6 @@ - diff --git a/src/Esquio.UI.Client/Program.cs b/src/Esquio.UI.Client/Program.cs index ef635721..02702037 100644 --- a/src/Esquio.UI.Client/Program.cs +++ b/src/Esquio.UI.Client/Program.cs @@ -17,7 +17,6 @@ public class Program { public static async Task Main(string[] args) { - //await ConfigureHost(args).Build().RunAsync(); var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents @@ -81,65 +80,5 @@ public static async Task Main(string[] args) await host.RunAsync(); } - - //static WebAssemblyHostBuilder ConfigureHost(string[] args) - //{ - // var builder = WebAssemblyHostBuilder.CreateDefault(args); - - // builder.RootComponents - // .Add("app"); - - // builder.Logging - // .SetMinimumLevel(LogLevel.Warning); - - // builder.Services.AddHttpClient(client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)) - // .AddHttpMessageHandler(); - - // var isAzureAd = builder.Configuration.GetValue("Security:IsAzureAd"); - // var authority = builder.Configuration.GetValue("Security:Authority"); - // var clientId = builder.Configuration.GetValue("Security:ClientId"); - // var scope = builder.Configuration.GetValue("Security:Scope"); - // var responseType = builder.Configuration.GetValue("Security:ResponseType"); - - // if (isAzureAd) - // { - // builder.Services.AddMsalAuthentication(options => - // { - // options.ProviderOptions.Authentication.Authority = authority; - // options.ProviderOptions.Authentication.ClientId = clientId; - // options.ProviderOptions.DefaultAccessTokenScopes.Add(scope); - // }); - // } - // else - // { - // builder.Services.AddOidcAuthentication(options => - // { - // options.ProviderOptions.Authority = authority; - // options.ProviderOptions.ClientId = clientId; - // options.ProviderOptions.ResponseType = responseType; - // options.ProviderOptions.DefaultScopes.Add(scope); - // }); - // } - - // var jsRuntime = builder.Services.BuildServiceProvider().GetRequiredService(); - // jsRuntime.InvokeVoidAsync("addAuthenticationScript", new object[] { isAzureAd }); - - // builder.Services.AddAuthorizationCore(options => - // { - // options.AddPolicy(Policies.Reader, builder => builder.AddRequirements(new PolicyRequirement(Policies.Reader))); - // options.AddPolicy(Policies.Contributor, builder => builder.AddRequirements(new PolicyRequirement(Policies.Contributor))); - // options.AddPolicy(Policies.Management, builder => builder.AddRequirements(new PolicyRequirement(Policies.Management))); - // }); - - // builder.Services.AddScoped(); - // builder.Services.AddScoped(); - // builder.Services.AddScoped(); - // builder.Services.AddScoped(); - // builder.Services.AddScoped(); - // builder.Services.AddScoped(); - - - // return builder; - //} } } diff --git a/tests/FunctionalTests/Constants.cs b/tests/FunctionalTests/Constants.cs index d62b9095..60fffc49 100644 --- a/tests/FunctionalTests/Constants.cs +++ b/tests/FunctionalTests/Constants.cs @@ -2,6 +2,7 @@ { public static class Constants { + public const string DEFAULT_HTTPAPI_VERSION = "5.0"; public const string FeatureName = "default-feature-name"; public const string ProductName = "default-product-name"; } diff --git a/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs b/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs index 1d25b798..280f5540 100644 --- a/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs +++ b/tests/FunctionalTests/Esquio.Http.Store/EsquioHttpStoreTests.cs @@ -274,7 +274,7 @@ await _fixture.Given .Should() .BeEquivalentTo(feature.Name); - var cacheKey = CacheKeyCreator.GetCacheKey(product.Name, feature.Name, defaultRing.Name,"5.0"); + var cacheKey = CacheKeyCreator.GetCacheKey(product.Name, feature.Name, defaultRing.Name, Constants.DEFAULT_HTTPAPI_VERSION); var entry = await cache.GetStringAsync(cacheKey); @@ -428,7 +428,7 @@ await _fixture.Given .Should() .BeEquivalentTo(feature.Name); - var cacheKey = CacheKeyCreator.GetCacheKey(product.Name, feature.Name, defaultRing.Name,"3.0"); + var cacheKey = CacheKeyCreator.GetCacheKey(product.Name, feature.Name, defaultRing.Name, "3.0"); var entry = await cache.GetStringAsync(cacheKey); diff --git a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs index 80a8e9a8..f713c834 100644 --- a/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs +++ b/tests/FunctionalTests/Esquio.UI.Api/Scenarios/Versioning/VersioningTests.cs @@ -54,7 +54,7 @@ await _fixture.Given var response = await _fixture.TestServer .CreateRequest(ApiDefinitions.V5.Permissions.My()) - .AddHeader("X-API-VERSION", "5.0") + .AddHeader("X-API-VERSION", Constants.DEFAULT_HTTPAPI_VERSION) .WithIdentity(Builders.Identity().WithDefaultClaims().Build()) .GetAsync(); From 292674aff4962a9e5f74bb4d5539989b38ba8d51 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Thu, 15 Oct 2020 21:33:30 +0200 Subject: [PATCH 04/15] Migration Esquio to .NET5, fix some configuration issues but still no compile all solution --- build/dependencies.props | 22 +++++++++---------- .../Esquio.AspNetCore.csproj | 2 +- src/Esquio.UI.Client/Esquio.UI.Client.csproj | 3 +-- src/Esquio/Esquio.csproj | 13 +++++------ 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index cadffd5b..a29073b8 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,21 +2,21 @@ net5.0 16.8.0-preview-20200921-01 - 3.0 + preview 1.0.0 - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) - 4.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) + 5.0.0$(VersionSuffix) \ No newline at end of file diff --git a/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj b/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj index eca946ae..57c561d9 100644 --- a/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj +++ b/src/Esquio.AspNetCore/Esquio.AspNetCore.csproj @@ -10,7 +10,7 @@ true - + diff --git a/src/Esquio.UI.Client/Esquio.UI.Client.csproj b/src/Esquio.UI.Client/Esquio.UI.Client.csproj index e498eabe..aab3020f 100644 --- a/src/Esquio.UI.Client/Esquio.UI.Client.csproj +++ b/src/Esquio.UI.Client/Esquio.UI.Client.csproj @@ -1,8 +1,6 @@  - $(NetFrameworkVersion) - $(RazorLangVersion) @@ -13,6 +11,7 @@ + diff --git a/src/Esquio/Esquio.csproj b/src/Esquio/Esquio.csproj index 8832f01b..4dc3e74b 100644 --- a/src/Esquio/Esquio.csproj +++ b/src/Esquio/Esquio.csproj @@ -1,7 +1,7 @@  - $(NetFrameworkVersion) + $(NetFrameworkVersion) Feature Toogles Library for .NET .For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore $(esquio) @@ -12,13 +12,12 @@ - + - - - - - + + + + From 7fa0a92b593f128787754d1498da8e279bb21588 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Fri, 16 Oct 2020 11:15:06 +0200 Subject: [PATCH 05/15] Updated dependencies props --- Directory.Build.targets | 2 +- .../Client/Pages/FetchData.razor | 74 +++++++++++-------- .../Server/appsettings.json | 2 +- .../Esquio.UI.Api.Shared.csproj | 1 + src/Esquio.UI.Client/Esquio.UI.Client.csproj | 8 +- 5 files changed, 50 insertions(+), 37 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index a83dd501..d81468dd 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -38,7 +38,7 @@ - + diff --git a/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor b/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor index 63cce544..947c691e 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor +++ b/samples/GettingStarted.Blazor.WebAssembly/Client/Pages/FetchData.razor @@ -1,39 +1,55 @@ @page "/fetchdata" @using GettingStarted.Blazor.WebAssembly.Shared +@using Esquio.Blazor.WebAssembly @inject HttpClient Http

Weather forecast

This component demonstrates fetching data from the server.

-@if (forecasts == null) -{ -

Loading...

-} -else -{ - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
-} + + +

LOADING

+
+ + @if (forecasts == null) + { +

Loading...

+ } + else + { + + + + + + + + + + + + + @foreach (var forecast in forecasts) + { + + + + + + + } + +
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
+ + + } +
+

HidenGem is not enabled!

+
+ + + @code { private WeatherForecast[] forecasts; @@ -43,4 +59,4 @@ else forecasts = await Http.GetFromJsonAsync("WeatherForecast"); } -} +} \ No newline at end of file diff --git a/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json b/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json index 3d4ee6e5..9b9d661c 100644 --- a/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json +++ b/samples/GettingStarted.Blazor.WebAssembly/Server/appsettings.json @@ -14,7 +14,7 @@ "Features": [ { "Name": "HiddenGem", - "Enabled": true, + "Enabled": false, "Toggles": [] } ] diff --git a/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj b/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj index 691334e5..33563781 100644 --- a/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj +++ b/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj @@ -6,6 +6,7 @@ + diff --git a/src/Esquio.UI.Client/Esquio.UI.Client.csproj b/src/Esquio.UI.Client/Esquio.UI.Client.csproj index aab3020f..fc3aa0dc 100644 --- a/src/Esquio.UI.Client/Esquio.UI.Client.csproj +++ b/src/Esquio.UI.Client/Esquio.UI.Client.csproj @@ -7,19 +7,17 @@ + - - - +
- @@ -29,6 +27,4 @@ Always
- -
\ No newline at end of file From 4f8a75d3f294077234097fdd365b68098c23ba04 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Fri, 16 Oct 2020 12:50:01 +0200 Subject: [PATCH 06/15] Continue working on .NET5 migration, remove fluentvalidation.aspnetcore dependency with framework reference --- src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj | 2 +- src/Esquio.UI.Api/Esquio.UI.Api.csproj | 1 - src/Esquio.UI.Client/_Imports.razor | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj b/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj index 33563781..94e344c8 100644 --- a/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj +++ b/src/Esquio.UI.Api.Shared/Esquio.UI.Api.Shared.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Esquio.UI.Api/Esquio.UI.Api.csproj b/src/Esquio.UI.Api/Esquio.UI.Api.csproj index 150c6ef7..470b650f 100644 --- a/src/Esquio.UI.Api/Esquio.UI.Api.csproj +++ b/src/Esquio.UI.Api/Esquio.UI.Api.csproj @@ -15,7 +15,6 @@ - diff --git a/src/Esquio.UI.Client/_Imports.razor b/src/Esquio.UI.Client/_Imports.razor index c76498cc..6e77916f 100644 --- a/src/Esquio.UI.Client/_Imports.razor +++ b/src/Esquio.UI.Client/_Imports.razor @@ -73,6 +73,4 @@ @using Esquio.UI.Api.Shared.Models.Statistics.Configuration -@using Esquio.Blazor.WebAssembly - From 6e4a1c321fbe180ee1ca502880c3feb66927f982 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Fri, 16 Oct 2020 13:24:14 +0200 Subject: [PATCH 07/15] update docker images --- build/DemoDockerfile | 4 ++-- build/UIDockerfile | 4 ++-- src/Esquio.UI.Client/Esquio.UI.Client.csproj | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/DemoDockerfile b/build/DemoDockerfile index cc3eb4b0..07e0e9ad 100644 --- a/build/DemoDockerfile +++ b/build/DemoDockerfile @@ -1,7 +1,7 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.6-buster-slim AS base +FROM mcr.microsoft.com/dotnet/aspnet:5.0.0-rc.2-buster-slim AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.1.401-buster AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0.100-rc.2-buster-slim AS build WORKDIR /src COPY ./Directory.Build.props ./Directory.Build.props COPY ./Directory.Build.targets ./Directory.Build.targets diff --git a/build/UIDockerfile b/build/UIDockerfile index 72530037..0d47d0df 100644 --- a/build/UIDockerfile +++ b/build/UIDockerfile @@ -1,7 +1,7 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.6-buster-slim AS base +FROM mcr.microsoft.com/dotnet/aspnet:5.0.0-rc.2-buster-slim AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.1.401-buster AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0.100-rc.2-buster-slim AS build WORKDIR /src COPY ./Directory.Build.props ./Directory.Build.props COPY ./Directory.Build.targets ./Directory.Build.targets diff --git a/src/Esquio.UI.Client/Esquio.UI.Client.csproj b/src/Esquio.UI.Client/Esquio.UI.Client.csproj index fc3aa0dc..793f144c 100644 --- a/src/Esquio.UI.Client/Esquio.UI.Client.csproj +++ b/src/Esquio.UI.Client/Esquio.UI.Client.csproj @@ -8,6 +8,7 @@ + From 70adc767ec4a102e2cf1b6db3f459d87708cb584 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Fri, 16 Oct 2020 13:58:05 +0200 Subject: [PATCH 08/15] Fix x-api-version to 5.0 --- .../Authorization/PolicyRequirementHandler.cs | 76 +++++++++---------- .../Services/EsquioHttpClient.cs | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Esquio.UI.Client/Infrastructure/Authorization/PolicyRequirementHandler.cs b/src/Esquio.UI.Client/Infrastructure/Authorization/PolicyRequirementHandler.cs index 4224cdd9..bf2efb5b 100644 --- a/src/Esquio.UI.Client/Infrastructure/Authorization/PolicyRequirementHandler.cs +++ b/src/Esquio.UI.Client/Infrastructure/Authorization/PolicyRequirementHandler.cs @@ -1,33 +1,33 @@ -using Esquio.UI.Client.Services; +using Esquio.UI.Client.Services; using Esquio.UI.Client.ViewModels; -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.Logging; -using System; -using System.Threading.Tasks; - -namespace Esquio.UI.Client.Infrastructure.Authorization -{ - class PolicyRequirementHandler : AuthorizationHandler - { - private readonly IEsquioHttpClient _esquioHttpClient; - private readonly IPolicyBuilder _policyBuilder; - private readonly EsquioState _state; - private readonly ILogger _logger; - - public PolicyRequirementHandler( - IEsquioHttpClient esquioHttpClient, - IPolicyBuilder policyBuilder, - EsquioState state, - ILogger logger) - { - _esquioHttpClient = esquioHttpClient ?? throw new ArgumentNullException(nameof(esquioHttpClient)); - _policyBuilder = policyBuilder ?? throw new ArgumentNullException(nameof(policyBuilder)); - _state = state ?? throw new ArgumentNullException(nameof(_state)); - _logger = logger ?? throw new ArgumentNullException(nameof(logger)); - } - - protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, PolicyRequirement requirement) - { +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Logging; +using System; +using System.Threading.Tasks; + +namespace Esquio.UI.Client.Infrastructure.Authorization +{ + class PolicyRequirementHandler : AuthorizationHandler + { + private readonly IEsquioHttpClient _esquioHttpClient; + private readonly IPolicyBuilder _policyBuilder; + private readonly EsquioState _state; + private readonly ILogger _logger; + + public PolicyRequirementHandler( + IEsquioHttpClient esquioHttpClient, + IPolicyBuilder policyBuilder, + EsquioState state, + ILogger logger) + { + _esquioHttpClient = esquioHttpClient ?? throw new ArgumentNullException(nameof(esquioHttpClient)); + _policyBuilder = policyBuilder ?? throw new ArgumentNullException(nameof(policyBuilder)); + _state = state ?? throw new ArgumentNullException(nameof(_state)); + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); + } + + protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, PolicyRequirement requirement) + { if (context.User != null && _state.LoggedUser == null) { var my = await _esquioHttpClient.GetMy(); @@ -70,12 +70,12 @@ protected override async Task HandleRequirementAsync(AuthorizationHandlerContex context.Fail(); } - context.Succeed(requirement); - } - - private void LogAuthorizationFailed(string subjectId, string permission) - { - _logger.LogWarning($"Authorization failed for user {subjectId} with required permission {permission}."); - } - } -} + context.Succeed(requirement); + } + + private void LogAuthorizationFailed(string subjectId, string permission) + { + _logger.LogWarning($"Authorization failed for user {subjectId} with required permission {permission}."); + } + } +} diff --git a/src/Esquio.UI.Client/Services/EsquioHttpClient.cs b/src/Esquio.UI.Client/Services/EsquioHttpClient.cs index 4ff6d052..fee305f5 100644 --- a/src/Esquio.UI.Client/Services/EsquioHttpClient.cs +++ b/src/Esquio.UI.Client/Services/EsquioHttpClient.cs @@ -110,7 +110,7 @@ public class EsquioHttpClient : IEsquioHttpClient { const string API_VERSION_HEADER_NAME = "x-api-version"; - const string API_VERSION_HEADER_VALUE = "3.0"; + const string API_VERSION_HEADER_VALUE = "5.0"; const string DEFAULT_CONTENT_TYPE = "application/json"; private readonly HttpClient _httpClient; From 0aa041f68ecbdf93b3408eb906dbab9f2af0cba8 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Mon, 19 Oct 2020 15:43:05 +0200 Subject: [PATCH 09/15] Disable nswag client generation meanwhile nswag.msbuild does not support .net 5 yet --- Directory.Build.targets | 2 +- src/Esquio.UI.Api/Esquio.UI.Api.csproj | 1 + tools/Esquio.CliTool/Esquio.CliTool.csproj | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index d81468dd..71b3c253 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -51,7 +51,7 @@ - + diff --git a/src/Esquio.UI.Api/Esquio.UI.Api.csproj b/src/Esquio.UI.Api/Esquio.UI.Api.csproj index 470b650f..2e413501 100644 --- a/src/Esquio.UI.Api/Esquio.UI.Api.csproj +++ b/src/Esquio.UI.Api/Esquio.UI.Api.csproj @@ -42,6 +42,7 @@ + + From 030ca0615d78a4e399bb8632d98854e249fee26a Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Mon, 19 Oct 2020 16:30:05 +0200 Subject: [PATCH 10/15] Update pomelo to use .net 5 preview package --- Directory.Build.targets | 4 ++-- NuGet.config | 1 + tests/FunctionalTests/appsettings.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 71b3c253..c9a56198 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -39,7 +39,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/NuGet.config b/NuGet.config index 43593dd8..ad8b85fe 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/tests/FunctionalTests/appsettings.json b/tests/FunctionalTests/appsettings.json index c11ca591..527eb0ca 100644 --- a/tests/FunctionalTests/appsettings.json +++ b/tests/FunctionalTests/appsettings.json @@ -1,6 +1,6 @@ { "Data": { - "Store": "SqlServer", //use MySql or NpgSql to tests MySql and Postgres + "Store": "SqlServer", //use SqlServer,MySql or NpgSql to tests SqlServer, MySql and Postgres "ConnectionString": "Server=tcp:localhost,5433;Initial Catalog=Esquio.UI.Tests;User Id=sa;Password=Password12!" //"ConnectionString": "Server=127.0.0.1;Database=Esquio.UI.Tests;Uid=root;Pwd=Password12!;" //"ConnectionString": "Host=localhost;Port=5434;Database=Esquio.UI.Tests;User Id=postgres;Password=Password12!" From ab02747f6c651d2a10a883c882762346ffc779e0 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Mon, 9 Nov 2020 16:25:01 +0100 Subject: [PATCH 11/15] Upgrade some versions --- Directory.Build.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index c9a56198..2efeb8b1 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -33,13 +33,13 @@ - + - + From 734a875255aa09e7abe003d0ec76bea1a3ab9051 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Wed, 11 Nov 2020 18:07:08 +0100 Subject: [PATCH 12/15] Update versions --- Directory.Build.targets | 70 +++++----- build/dependencies.props | 4 +- demos/WebApp/WebApp.csproj | 11 +- .../Esquio.Configuration.Store.csproj | 2 +- .../Esquio.Http.Store.csproj | 9 +- src/Esquio.UI.Api/Esquio.UI.Api.csproj | 9 +- src/Esquio.UI.Api/swagger.json | 4 +- src/Esquio/Esquio.csproj | 2 +- tools/Esquio.CliTool/Esquio.CliTool.csproj | 13 +- tools/Esquio.CliTool/Internal/EsquioClient.cs | 120 ++++++++++-------- 10 files changed, 133 insertions(+), 111 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 7d993932..94dd0a71 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -9,43 +9,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + + @@ -53,11 +53,11 @@ - - + + - + diff --git a/build/dependencies.props b/build/dependencies.props index a29073b8..80f86753 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,8 +1,8 @@ net5.0 - 16.8.0-preview-20200921-01 - + netstandard21 + 16.8.0 preview 1.0.0 diff --git a/demos/WebApp/WebApp.csproj b/demos/WebApp/WebApp.csproj index d719dfa2..cbd452f5 100644 --- a/demos/WebApp/WebApp.csproj +++ b/demos/WebApp/WebApp.csproj @@ -8,14 +8,15 @@ - - - - - + + + + + + diff --git a/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj b/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj index 24bac037..455efeab 100644 --- a/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj +++ b/src/Esquio.Configuration.Store/Esquio.Configuration.Store.csproj @@ -1,7 +1,7 @@  - $(NetFrameworkVersion) + $(NetStandardVersion) Configuration store support for Esquio. For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore;Configuration $(esquioconfigurationstore) diff --git a/src/Esquio.Http.Store/Esquio.Http.Store.csproj b/src/Esquio.Http.Store/Esquio.Http.Store.csproj index 99e829f9..978ee456 100644 --- a/src/Esquio.Http.Store/Esquio.Http.Store.csproj +++ b/src/Esquio.Http.Store/Esquio.Http.Store.csproj @@ -1,7 +1,7 @@  - $(NetFrameworkVersion) + $(NetStandardVersion) Distributed store support for Esquio. For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore;Store;Distributed Store $(esquiohttpstore) @@ -9,12 +9,13 @@ $(esquiodistributedstore) $(LangVersion) true + 0e5fa2e1-fd88-4fc1-8624-d04541aab319 - - - + + + diff --git a/src/Esquio.UI.Api/Esquio.UI.Api.csproj b/src/Esquio.UI.Api/Esquio.UI.Api.csproj index 2e413501..6df7a916 100644 --- a/src/Esquio.UI.Api/Esquio.UI.Api.csproj +++ b/src/Esquio.UI.Api/Esquio.UI.Api.csproj @@ -42,10 +42,9 @@ - - + + + + diff --git a/src/Esquio.UI.Api/swagger.json b/src/Esquio.UI.Api/swagger.json index d3d147d3..a5c76d96 100644 --- a/src/Esquio.UI.Api/swagger.json +++ b/src/Esquio.UI.Api/swagger.json @@ -1,5 +1,5 @@ { - "x-generator": "NSwag v13.6.2.0 (NJsonSchema v10.1.23.0 (Newtonsoft.Json v12.0.0.0))", + "x-generator": "NSwag v13.9.0.0 (NJsonSchema v10.3.0.0 (Newtonsoft.Json v12.0.0.0))", "swagger": "2.0", "info": { "title": "My Title", @@ -1641,6 +1641,7 @@ }, "ProblemDetails": { "type": "object", + "additionalProperties": {}, "properties": { "type": { "type": "string" @@ -1732,6 +1733,7 @@ }, { "type": "object", + "additionalProperties": {}, "properties": { "errors": { "type": "object", diff --git a/src/Esquio/Esquio.csproj b/src/Esquio/Esquio.csproj index 4dc3e74b..c4b6c765 100644 --- a/src/Esquio/Esquio.csproj +++ b/src/Esquio/Esquio.csproj @@ -1,7 +1,7 @@  - $(NetFrameworkVersion) + $(NetStandardVersion) Feature Toogles Library for .NET .For more information see http://github.com/Xabaril/Esquio Esquio;Features;Flags;Toggles;AB Testing;AspNetCore $(esquio) diff --git a/tools/Esquio.CliTool/Esquio.CliTool.csproj b/tools/Esquio.CliTool/Esquio.CliTool.csproj index e1e5e36f..84f57beb 100644 --- a/tools/Esquio.CliTool/Esquio.CliTool.csproj +++ b/tools/Esquio.CliTool/Esquio.CliTool.csproj @@ -10,18 +10,17 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + diff --git a/tools/Esquio.CliTool/Internal/EsquioClient.cs b/tools/Esquio.CliTool/Internal/EsquioClient.cs index 02a553b1..656f8c25 100644 --- a/tools/Esquio.CliTool/Internal/EsquioClient.cs +++ b/tools/Esquio.CliTool/Internal/EsquioClient.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v13.9.0.0 (NJsonSchema v10.3.0.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) // //---------------------- @@ -9,12 +9,13 @@ #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." +#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" namespace Esquio.CliTool.Internal { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.9.0.0 (NJsonSchema v10.3.0.0 (Newtonsoft.Json v12.0.0.0))")] public partial class EsquioClient { private string _baseUrl = ""; @@ -3975,7 +3976,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { if (value == null) { - return null; + return ""; } if (value is System.Enum) @@ -3994,7 +3995,8 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - return System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); + var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); + return converted == null ? string.Empty : converted; } } else if (value is bool) @@ -4016,7 +4018,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListAuditRequest { [Newtonsoft.Json.JsonProperty("pageIndex", Required = Newtonsoft.Json.Required.Always)] @@ -4028,7 +4030,7 @@ public partial class ListAuditRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ProblemDetails { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4049,10 +4051,19 @@ public partial class ProblemDetails [Newtonsoft.Json.JsonProperty("extensions", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.IDictionary Extensions { get; set; } + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListApiKeyResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -4070,7 +4081,7 @@ public partial class PaginatedResultOfListApiKeyResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListApiKeyResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4083,7 +4094,7 @@ public partial class ListApiKeyResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsApiKeyResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4099,16 +4110,25 @@ public partial class DetailsApiKeyResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ValidationProblemDetails : ProblemDetails { [Newtonsoft.Json.JsonProperty("errors", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Collections.Generic.IDictionary> Errors { get; set; } + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddApiKeyRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4123,7 +4143,7 @@ public partial class AddApiKeyRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddFeatureRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4138,7 +4158,7 @@ public partial class AddFeatureRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class UpdateFeatureRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4150,7 +4170,7 @@ public partial class UpdateFeatureRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsFeatureResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4165,7 +4185,7 @@ public partial class DetailsFeatureResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ToggleDetail { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4180,7 +4200,7 @@ public partial class ToggleDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ParameterDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4192,7 +4212,7 @@ public partial class ParameterDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class StateFeatureResponse { [Newtonsoft.Json.JsonProperty("states", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4201,7 +4221,7 @@ public partial class StateFeatureResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class StateFeatureResponseDetail { [Newtonsoft.Json.JsonProperty("deploymentName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4216,7 +4236,7 @@ public partial class StateFeatureResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListFeatureResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -4234,7 +4254,7 @@ public partial class PaginatedResultOfListFeatureResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListFeatureResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4249,7 +4269,7 @@ public partial class ListFeatureResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class MyResponse { [Newtonsoft.Json.JsonProperty("isAuthorized", Required = Newtonsoft.Json.Required.Always)] @@ -4261,7 +4281,7 @@ public partial class MyResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListUsersResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -4279,7 +4299,7 @@ public partial class PaginatedResultOfListUsersResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListUsersResponseDetail { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4291,7 +4311,7 @@ public partial class ListUsersResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsPermissionResponse { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4303,7 +4323,7 @@ public partial class DetailsPermissionResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddPermissionRequest { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4315,7 +4335,7 @@ public partial class AddPermissionRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class UpdatePermissionRequest { [Newtonsoft.Json.JsonProperty("subjectId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4327,7 +4347,7 @@ public partial class UpdatePermissionRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class PaginatedResultOfListProductResponseDetail { [Newtonsoft.Json.JsonProperty("total", Required = Newtonsoft.Json.Required.Always)] @@ -4345,7 +4365,7 @@ public partial class PaginatedResultOfListProductResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ListProductResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4357,7 +4377,7 @@ public partial class ListProductResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsProductResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4372,7 +4392,7 @@ public partial class DetailsProductResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DeploymentResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4384,7 +4404,7 @@ public partial class DeploymentResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ExportProductResponse { [Newtonsoft.Json.JsonProperty("content", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4393,7 +4413,7 @@ public partial class ExportProductResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ImportProductRequest { [Newtonsoft.Json.JsonProperty("content", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4402,7 +4422,7 @@ public partial class ImportProductRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddProductRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4417,7 +4437,7 @@ public partial class AddProductRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class UpdateProductRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4429,7 +4449,7 @@ public partial class UpdateProductRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddDeploymentRequest { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4438,7 +4458,7 @@ public partial class AddDeploymentRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsConfigurationResponse { [Newtonsoft.Json.JsonProperty("featureName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4453,7 +4473,7 @@ public partial class DetailsConfigurationResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsConfigurationRequest { [Newtonsoft.Json.JsonProperty("productName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4465,7 +4485,7 @@ public partial class DetailsConfigurationRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class TagResponseDetail { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4477,7 +4497,7 @@ public partial class TagResponseDetail } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddTagRequest { [Newtonsoft.Json.JsonProperty("tag", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4489,7 +4509,7 @@ public partial class AddTagRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class DetailsToggleResponse { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4510,7 +4530,7 @@ public partial class DetailsToggleResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ParameterDetail2 { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4525,7 +4545,7 @@ public partial class ParameterDetail2 } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class RevealToggleResponse { [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4537,7 +4557,7 @@ public partial class RevealToggleResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class RevealToggleParameterResponse { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4552,7 +4572,7 @@ public partial class RevealToggleParameterResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class KnownTypesToggleResponse { [Newtonsoft.Json.JsonProperty("scannedAssemblies", Required = Newtonsoft.Json.Required.Always)] @@ -4564,7 +4584,7 @@ public partial class KnownTypesToggleResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class KnownTypesToggleDetailResponse { [Newtonsoft.Json.JsonProperty("assembly", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4582,7 +4602,7 @@ public partial class KnownTypesToggleDetailResponse } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddParameterToggleRequest { [Newtonsoft.Json.JsonProperty("productName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4606,7 +4626,7 @@ public partial class AddParameterToggleRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddToggleRequest { [Newtonsoft.Json.JsonProperty("productName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4627,7 +4647,7 @@ public partial class AddToggleRequest } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.3.0.0 (Newtonsoft.Json v12.0.0.0)")] public partial class AddToggleRequestDetailParameter { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -4642,7 +4662,7 @@ public partial class AddToggleRequestDetailParameter } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.9.0.0 (NJsonSchema v10.3.0.0 (Newtonsoft.Json v12.0.0.0))")] public partial class ApiException : System.Exception { public int StatusCode { get; private set; } @@ -4665,7 +4685,7 @@ public override string ToString() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.9.0.0 (NJsonSchema v10.3.0.0 (Newtonsoft.Json v12.0.0.0))")] public partial class ApiException : ApiException { public TResult Result { get; private set; } From 4ad2f71e6b45317e6ba99f95c9b24b74eaba2c55 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Wed, 11 Nov 2020 18:17:56 +0100 Subject: [PATCH 13/15] Upgrade github actions for new version and new sdk --- .github/workflows/cd-docker-internal-demo.yml | 2 +- .github/workflows/cd-docker-ui-preview.yml | 2 +- .github/workflows/cd.yml | 2 +- .github/workflows/ci_all_branches.yml | 2 +- .github/workflows/ci_master.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/preview.yml | 2 +- build/DemoDockerfile | 4 ++-- build/UIDockerfile | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd-docker-internal-demo.yml b/.github/workflows/cd-docker-internal-demo.yml index e41a9bb3..a3cc5542 100644 --- a/.github/workflows/cd-docker-internal-demo.yml +++ b/.github/workflows/cd-docker-internal-demo.yml @@ -4,7 +4,7 @@ on: tags: - internal-demo-release-* # Push events to release-* env: - TAG: 4.0.${{ github.run_id }} + TAG: 5.0.${{ github.run_id }} REGISTRY: esquio.azurecr.io ACR_REPO_APP: esquiodemointernalapp ACR_REPO_UI: esquiodemointernalui diff --git a/.github/workflows/cd-docker-ui-preview.yml b/.github/workflows/cd-docker-ui-preview.yml index 0f6b3b69..8b989002 100644 --- a/.github/workflows/cd-docker-ui-preview.yml +++ b/.github/workflows/cd-docker-ui-preview.yml @@ -4,7 +4,7 @@ on: tags: - ui-preview-* # Push events to release-* env: - TAG: 4.0.${{ github.run_id }}-preview + TAG: 5.0.${{ github.run_id }}-preview IMAGE_NAME: esquioui ESQUIO_REPO: xabarilcoding jobs: diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e1ca9471..e5abbfef 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100-rc.2.20479.15 + dotnet-version: 5.0.100 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/ci_all_branches.yml b/.github/workflows/ci_all_branches.yml index d1f2bc9f..9c65ffa8 100644 --- a/.github/workflows/ci_all_branches.yml +++ b/.github/workflows/ci_all_branches.yml @@ -33,7 +33,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100-rc.2.20479.15 + dotnet-version: 5.0.100 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml index c23c3001..6a6a1db2 100644 --- a/.github/workflows/ci_master.yml +++ b/.github/workflows/ci_master.yml @@ -39,7 +39,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100-rc.2.20479.15 + dotnet-version: 5.0.100 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6ad12e4d..933b09b4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100-rc.2.20479.15 + dotnet-version: 5.0.100 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index ee8a3c49..ed383069 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -37,7 +37,7 @@ jobs: - name: Setup .NET Core SDK uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100-rc.2.20479.15 + dotnet-version: 5.0.100 - name: dotnet build run: dotnet build Esquio.sln -c $BUILD_CONFIG - name: dotnet test [UnitTests] diff --git a/build/DemoDockerfile b/build/DemoDockerfile index 07e0e9ad..1b7f88ef 100644 --- a/build/DemoDockerfile +++ b/build/DemoDockerfile @@ -1,7 +1,7 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0.0-rc.2-buster-slim AS base +FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/sdk:5.0.100-rc.2-buster-slim AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build WORKDIR /src COPY ./Directory.Build.props ./Directory.Build.props COPY ./Directory.Build.targets ./Directory.Build.targets diff --git a/build/UIDockerfile b/build/UIDockerfile index 0d47d0df..6aea37e6 100644 --- a/build/UIDockerfile +++ b/build/UIDockerfile @@ -1,7 +1,7 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0.0-rc.2-buster-slim AS base +FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/sdk:5.0.100-rc.2-buster-slim AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build WORKDIR /src COPY ./Directory.Build.props ./Directory.Build.props COPY ./Directory.Build.targets ./Directory.Build.targets From 2d7ca453d4c8f33b7ef8731594fbc679d8234021 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Wed, 11 Nov 2020 18:18:32 +0100 Subject: [PATCH 14/15] Upgrade install-sdk|sh for new sdk --- install-sdk.ps1 | 2 +- install-sdk.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install-sdk.ps1 b/install-sdk.ps1 index 9c429509..ed16b025 100644 --- a/install-sdk.ps1 +++ b/install-sdk.ps1 @@ -1,2 +1,2 @@ -$SdkVersion = "5.0.100-rc.2.20479.15" +$SdkVersion = "5.0.100" & "./dotnet-install.ps1" -Version $SdkVersion \ No newline at end of file diff --git a/install-sdk.sh b/install-sdk.sh index 4a189bdc..6f1c3cb2 100644 --- a/install-sdk.sh +++ b/install-sdk.sh @@ -1,5 +1,5 @@ #!/bin/bash -SdkVersion="5.0.100-rc.2.20479.15" +SdkVersion="5.0.100" ./dotnet-install.sh -Version $SdkVersion export PATH="$PATH:$HOME/.dotnet" From 9f3ad1c41fb8528e4aa244295d076c1cdf0fe4c1 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Wed, 11 Nov 2020 18:25:33 +0100 Subject: [PATCH 15/15] Update global.json sdk version --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index bb17fc04..43f227c2 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "projects": [ "src", "tests", "samples"], "sdk": { - "version": "5.0.100-rc.2.20479.15" + "version": "5.0.100" } } \ No newline at end of file