diff --git a/.github/workflows/project-regular-checks.yml b/.github/workflows/project-regular-checks.yml index 168a25f..b61ad89 100644 --- a/.github/workflows/project-regular-checks.yml +++ b/.github/workflows/project-regular-checks.yml @@ -11,11 +11,11 @@ jobs: name: Build & Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: 9 + dotnet-version: 10 - name: Restore Dependencies run: dotnet restore - name: Format Solution @@ -23,4 +23,10 @@ jobs: - name: Build Solution run: dotnet build --no-restore -c Release - name: Run Tests - run: dotnet test + run: | + dotnet test \ + --coverage \ + --coverage-output-format cobertura \ + --coverage-output .coverage/coverage.cobertura.xml \ + --report-trx \ + --results-directory .coverage diff --git a/.gitignore b/.gitignore index 894a117..fd954be 100644 --- a/.gitignore +++ b/.gitignore @@ -18,13 +18,11 @@ bld/ # visual studio code .vscode/ -# dotnet sdk -global.json - # generated file **/Generated/**/*.cs **/.benchmark/** **/**/*.dll +.coverage/ # generated schemas **/*.schema.json diff --git a/Directory.Build.props b/Directory.Build.props index bf92fb2..9e894be 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,8 @@ - net9.0 - 13.0 + net10.0 + 14.0 true enable enable @@ -10,6 +10,7 @@ true true true + true diff --git a/Directory.Packages.props b/Directory.Packages.props index 52ff8b5..a17c949 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,36 +5,38 @@ - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + - - - - + + + + - + \ No newline at end of file diff --git a/aspire/Aspire.ServiceDefaults/Extensions.cs b/aspire/Aspire.ServiceDefaults/Extensions.cs index 0a2ee48..761d34f 100644 --- a/aspire/Aspire.ServiceDefaults/Extensions.cs +++ b/aspire/Aspire.ServiceDefaults/Extensions.cs @@ -51,9 +51,9 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati }) .WithTracing(tracing => { + // Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package) + //.AddGrpcClientInstrumentation() tracing.AddAspNetCoreInstrumentation() - // Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package) - //.AddGrpcClientInstrumentation() .AddHttpClientInstrumentation(); }); @@ -83,8 +83,8 @@ private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostAppli public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicationBuilder builder) { + // Add a default liveness check to ensure app is responsive builder.Services.AddHealthChecks() - // Add a default liveness check to ensure app is responsive .AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]); return builder; diff --git a/csharp/CSharp/Assignments.cs b/csharp/CSharp/Assignments.cs new file mode 100644 index 0000000..c7bd3db --- /dev/null +++ b/csharp/CSharp/Assignments.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.Logging; + +namespace CSharp; + +public class Assignments(ILogger _logger) +{ + public Data? NullableData { get; set; } = default; + + public void NullConditional() + { + NullableData?.Value = "test"; + + _logger.LogInformation($"Before data is created, NullableData: {NullableData}"); + + NullableData = new(); + NullableData?.Value = "test"; + + _logger.LogInformation($"After data is created, NullableData: {NullableData} - Value: {NullableData?.Value}"); + } + + public class Data + { + public string? Value { get; set; } + } +} \ No newline at end of file diff --git a/csharp/CSharp/CollectionExpressions.cs b/csharp/CSharp/CollectionExpressions.cs index 14a72f7..e26f915 100644 --- a/csharp/CSharp/CollectionExpressions.cs +++ b/csharp/CSharp/CollectionExpressions.cs @@ -34,6 +34,19 @@ public void CollectionInitialization() _logger.LogInformation($"Array initialization with spread element and members: {string.Join(',', anotherIntCollection)}"); } + public void Conversions() + { + int[] numbers = [1, 2, 3]; + + // T[] -> Span + Span spanNumbers = numbers; + _logger.LogInformation($"Implicit Conversion int[] -> span: {string.Join(',', spanNumbers.ToArray())}"); + + // T[] -> ReadOnlySpan + ReadOnlySpan readOnlyNumbers = numbers; + _logger.LogInformation($"Implicit Conversion int[] -> ReadOnlySpan: {string.Join(',', readOnlyNumbers.ToArray())}"); + } + public void CallMethods() { SomeMethod("arg1", "arg2", "arg3"); @@ -50,4 +63,19 @@ public void SomeOtherMethod(string[] args) { _logger.LogInformation($"SomeOtherMethod is called with args: {string.Join(',', args)}"); } + + public void ExtensionMembers() + { + IEnumerable empty = []; + IEnumerable numbers = [1, 2, 3]; + + _logger.LogInformation($"Extension property (instance-like): empty.IsEmpty => {empty.IsEmpty}"); + _logger.LogInformation($"Extension property (instance-like): numbers.IsEmpty => {numbers.IsEmpty}"); + + var combined = IEnumerable.Combine(numbers, [4, 5]); + _logger.LogInformation($"Type extension method (static-like): IEnumerable.Combine() => {string.Join(',', combined)}"); + + var initialized = IEnumerable.Initialized; + _logger.LogInformation($"Type extension property (static-like): IEnumerable.Initialized count => {initialized.Count()}"); + } } \ No newline at end of file diff --git a/csharp/CSharp/ExtensionMembers.cs b/csharp/CSharp/ExtensionMembers.cs new file mode 100644 index 0000000..ac2a024 --- /dev/null +++ b/csharp/CSharp/ExtensionMembers.cs @@ -0,0 +1,15 @@ +namespace CSharp; + +public static class ExtensionMembers +{ + extension(IEnumerable source) + { + public bool IsEmpty => !source.Any(); + } + + extension(IEnumerable) + { + public static IEnumerable Combine(IEnumerable first, IEnumerable second) => first.Concat(second); + public static IEnumerable Initialized => []; + } +} \ No newline at end of file diff --git a/csharp/CSharp/LambdaParameters.cs b/csharp/CSharp/LambdaParameters.cs index 7c57a00..c672608 100644 --- a/csharp/CSharp/LambdaParameters.cs +++ b/csharp/CSharp/LambdaParameters.cs @@ -2,7 +2,7 @@ namespace CSharp; -public class LambdaParameters(ILogger _logger) +public class LambdaParameters(ILogger _logger) { public void OptionalParameters() { @@ -32,4 +32,14 @@ void Params(params int[] values) { } optional(); @params(); } + + private delegate bool TryParse(string text, out T result); + + public void ParameterModifiersWithoutTypes() + { + // Lambdas support modifiers (ref/in/out/scoped/ref readonly) without explicit parameter types when the target delegate type is known + TryParse parse = (text, out result) => int.TryParse(text, out result); + + _logger.LogInformation($"(text, out result) => int.TryParse: ok={parse("42", out int value)}, result={value}"); + } } \ No newline at end of file diff --git a/csharp/CSharp/Program.cs b/csharp/CSharp/Program.cs index 2fb469f..ac256b3 100644 --- a/csharp/CSharp/Program.cs +++ b/csharp/CSharp/Program.cs @@ -4,10 +4,12 @@ var serviceCollection = new ServiceCollection(); +serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); +serviceCollection.AddSingleton(); serviceCollection.AddLogging(options => { @@ -17,19 +19,27 @@ var serviceProvider = serviceCollection.BuildServiceProvider(); +var assignments = serviceProvider.GetRequiredService(); var collectionExpressions = serviceProvider.GetRequiredService(); var encodingDecoding = serviceProvider.GetRequiredService(); var lambdaParameters = serviceProvider.GetRequiredService(); var @params = serviceProvider.GetRequiredService(); +var propertiesAndFields = serviceProvider.GetRequiredService(); @params.Use(); +assignments.NullConditional(); + collectionExpressions.EmptyCollectionInitialization(); collectionExpressions.CollectionInitialization(); +collectionExpressions.Conversions(); collectionExpressions.CallMethods(); lambdaParameters.OptionalParameters(); lambdaParameters.ParamsArrayParameters(); lambdaParameters.NewAcceptedBehavior(); +lambdaParameters.ParameterModifiersWithoutTypes(); + +encodingDecoding.RunShowCases(); -encodingDecoding.RunShowCases(); \ No newline at end of file +propertiesAndFields.FieldKeyword(); \ No newline at end of file diff --git a/csharp/CSharp/PropertiesAndFields.cs b/csharp/CSharp/PropertiesAndFields.cs new file mode 100644 index 0000000..c8f0338 --- /dev/null +++ b/csharp/CSharp/PropertiesAndFields.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Logging; + +namespace CSharp; + +public class PropertiesAndFields(ILogger _logger) +{ + string _field = "field"; + + public string WithOutFieldKeyword { get => _field; set => _field = value; } + public string WithFieldKeyword { get; set => field = value.Trim(); } = "WithField"; + + public void FieldKeyword() + { + _logger.LogInformation($"_field => '{_field}'"); + _logger.LogInformation($"WithOutFieldKeyword => '{WithOutFieldKeyword}'"); + _logger.LogInformation($"WithFieldKeyword => '{WithFieldKeyword}'"); + } +} \ No newline at end of file diff --git a/csharp/README.md b/csharp/README.md index 36cdee7..d23a3b9 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -5,7 +5,9 @@ projects. What we have learned and implemented so far are the following. +- Assignments - Collection expressions - Different Params type usage - Encoding Decoding - Lambda Parameters +- Properties and fields \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 0000000..3140116 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/learn-dotnet.sln b/learn-dotnet.sln deleted file mode 100644 index 63677e7..0000000 --- a/learn-dotnet.sln +++ /dev/null @@ -1,335 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "analyzers", "analyzers", "{AF835CF7-F63E-4667-A84D-298D4FF2E095}" - ProjectSection(SolutionItems) = preProject - analyzers\README.md = analyzers\README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "central-package-management", "central-package-management", "{1388F723-B25D-4020-8F5B-B7A4B2BD067F}" - ProjectSection(SolutionItems) = preProject - central-package-management\README.md = central-package-management\README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectA", "central-package-management\ProjectA\ProjectA.csproj", "{C5868FAC-1628-4400-8018-7DD14E4A6119}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectB", "central-package-management\ProjectB\ProjectB.csproj", "{6AB76071-4AF2-49EF-ACDC-3F5EEBC73958}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dependency-injection", "dependency-injection", "{EA678579-BA95-403B-A700-5878CD3A13DD}" - ProjectSection(SolutionItems) = preProject - dependency-injection\README.md = dependency-injection\README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nullable-usage", "nullable-usage", "{1194D255-B8CE-4268-B5EA-8EB36A3A758F}" - ProjectSection(SolutionItems) = preProject - nullable-usage\README.md = nullable-usage\README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NullableUsage", "nullable-usage\NullableUsage\NullableUsage.csproj", "{0480A21D-4A63-4372-9AE1-77D60B56FB46}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "source-generator", "source-generator", "{64526710-CEFE-40C7-AA39-B2A1A87FF203}" - ProjectSection(SolutionItems) = preProject - source-generator\README.md = source-generator\README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cli", "Cli", "{AA74E944-135B-4227-9C3C-ECD46406B1A4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cli", "source-generator\Cli\Cli.csproj", "{1B87270E-1B6A-4E05-B6F4-5FA2435738BE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGen", "CodeGen", "{163CC013-E841-49A8-8A62-68B467683CE6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGen", "source-generator\CodeGen\CodeGen.csproj", "{0A91A2DA-6490-4EE5-AA0F-1B055966830C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{FAA54A28-B96D-494F-87CB-E823160D262D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Domain", "source-generator\Domain\Domain.csproj", "{FA89943C-FD8E-42C5-A2F9-23C58952C0D9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebApp", "WebApp", "{5F662200-07DC-4221-843C-AEAE137E4B96}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApp", "source-generator\WebApp\WebApp.csproj", "{5E26550D-8556-425E-99B9-9E932B931E2C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit-testing", "unit-testing", "{A3F73601-24CF-4396-B688-EA53EF91A4D4}" - ProjectSection(SolutionItems) = preProject - unit-testing\README.md = unit-testing\README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B9D12006-ABDC-42F2-8519-6C75A6A2554D}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - README.md = README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{E148C898-1BFD-4F28-8940-583CC50F90DB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTesting", "unit-testing\UnitTesting\UnitTesting.csproj", "{50715692-EE4A-4DE9-BA64-3226C20E7EFD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjection", "dependency-injection\DependencyInjection\DependencyInjection.csproj", "{50657568-23CD-4307-AB2E-86A3B03ECB01}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "publish-over-dockerfile", "publish-over-dockerfile", "{1B4C5600-1E5A-4797-B675-C459C7FB5454}" - ProjectSection(SolutionItems) = preProject - publish-over-dockerfile\README.md = publish-over-dockerfile\README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "regex-source-generators", "regex-source-generators", "{F93CB7AF-CA43-4D1E-883F-EEB4930FC679}" - ProjectSection(SolutionItems) = preProject - regex-source-generators\README.md = regex-source-generators\README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RegexSourceGenerators", "regex-source-generators\RegexSourceGenerators\RegexSourceGenerators.csproj", "{E9414ABB-3845-47C8-96AA-BAA4FEC51B7E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PublishOverDockerfile", "publish-over-dockerfile\PublishOverDockerfile\PublishOverDockerfile.csproj", "{51E8C5A1-9789-4619-8ACE-D25DB5460413}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "primary-constructor", "primary-constructor", "{3892B517-E16C-4BDB-8EE0-CB80F66C3B19}" - ProjectSection(SolutionItems) = preProject - primary-constructor\README.md = primary-constructor\README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrimaryConstructor", "primary-constructor\PrimaryConstructor\PrimaryConstructor.csproj", "{88921AF0-2327-4E02-A9FE-201C37670C01}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "exception-handling", "exception-handling", "{1D0A109B-6458-4C04-B400-F9484310595C}" - ProjectSection(SolutionItems) = preProject - exception-handling\README.md = exception-handling\README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExceptionHandling", "exception-handling\ExceptionHandling\ExceptionHandling.csproj", "{658DFE92-7D9E-4DD6-979C-57460629A5E2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "csharp", "csharp", "{8D3DAA2C-A035-47DC-92DE-A0DA501B32BF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "native-aot", "native-aot", "{A6FDF528-DB3B-4838-8D9D-F3E0F08DF97A}" - ProjectSection(SolutionItems) = preProject - native-aot\README.md = native-aot\README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeAOT", "native-aot\NativeAOT\NativeAOT.csproj", "{AD006E83-4501-47B5-BEEA-BA9326A3D630}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp", "csharp\CSharp\CSharp.csproj", "{7299B336-9340-4E15-B0EE-B59C2770D7EE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarking-in-dotnet", "benchmarking-in-dotnet", "{32202E5E-02C2-48CA-9D8D-687146EB0232}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkingInDotNet", "benchmarking-in-dotnet\BenchmarkingInDotNet\BenchmarkingInDotNet.csproj", "{6E92E509-834F-403C-A0B0-3B691F3C816D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "model-binders", "model-binders", "{1828D64E-F976-4B87-B37C-BD9E694E9482}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModelBinders", "model-binders\ModelBinders\ModelBinders.csproj", "{382B91E4-9043-4261-BBE7-BEA9C0137C07}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnalyzersSample", "analyzers\AnalyzersSample\AnalyzersSample.csproj", "{F7185339-B401-483F-8FB5-FBC9A1D4DBFC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "authentication", "authentication", "{8E574EE1-3694-4905-B0FA-BEE599B5C0F9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MultiAuthentication", "authentication\MultiAuthentication\MultiAuthentication.csproj", "{4719C295-752C-4464-8A7D-151A1B8A37DD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "swashbuckle", "swashbuckle", "{CC39E923-166C-43EB-BD80-6B89122CF7A5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Swashbuckle", "swashbuckle\Swashbuckle\Swashbuckle.csproj", "{C4535DDC-D848-4238-B99D-ED0C9767D64C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "openapi", "openapi", "{5EFD2336-9236-4C29-9CFD-077E702D6ACD}" - ProjectSection(SolutionItems) = preProject - openapi\README.md = openapi\README.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAPI", "openapi\OpenAPI\OpenAPI.csproj", "{AD45E9C7-D739-4513-8F01-3A6826E0F4FA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "reflection", "reflection", "{5771998F-DD44-4CEA-8B37-C2E90E5014AC}" - ProjectSection(SolutionItems) = preProject - reflection\README.md = reflection\README.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reflection", "reflection\Reflection\Reflection.csproj", "{E0B6EFF9-41D8-4EDF-8303-5977D6637FF6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "aspire", "aspire", "{6EAC4719-E994-426D-87BD-6BB12FF17232}" - ProjectSection(SolutionItems) = preProject - aspire\README.md = aspire\README.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.AppHost", "aspire\Aspire.AppHost\Aspire.AppHost.csproj", "{FF280BA1-B772-48AC-8110-065520F3B852}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.ServiceDefaults", "aspire\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj", "{EA1FCF65-B230-4932-9164-85C2E39449BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectA", "aspire\ProjectA\ProjectA.csproj", "{1F34FA6D-124F-42AD-BE5F-F31FF07B9E28}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectB", "aspire\ProjectB\ProjectB.csproj", "{0DCC0BF3-FDFF-4AF7-A080-6A5D9213386F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "localization", "localization", "{9F730981-E25D-4857-B870-B98B0398688B}" - ProjectSection(SolutionItems) = preProject - localization\README.md = localization\README.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Localization", "localization\Localization\Localization.csproj", "{614740C2-6A5E-4F93-BD55-C3DF9B7EF33F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C5868FAC-1628-4400-8018-7DD14E4A6119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C5868FAC-1628-4400-8018-7DD14E4A6119}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C5868FAC-1628-4400-8018-7DD14E4A6119}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C5868FAC-1628-4400-8018-7DD14E4A6119}.Release|Any CPU.Build.0 = Release|Any CPU - {6AB76071-4AF2-49EF-ACDC-3F5EEBC73958}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6AB76071-4AF2-49EF-ACDC-3F5EEBC73958}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AB76071-4AF2-49EF-ACDC-3F5EEBC73958}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6AB76071-4AF2-49EF-ACDC-3F5EEBC73958}.Release|Any CPU.Build.0 = Release|Any CPU - {0480A21D-4A63-4372-9AE1-77D60B56FB46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0480A21D-4A63-4372-9AE1-77D60B56FB46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0480A21D-4A63-4372-9AE1-77D60B56FB46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0480A21D-4A63-4372-9AE1-77D60B56FB46}.Release|Any CPU.Build.0 = Release|Any CPU - {1B87270E-1B6A-4E05-B6F4-5FA2435738BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B87270E-1B6A-4E05-B6F4-5FA2435738BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B87270E-1B6A-4E05-B6F4-5FA2435738BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B87270E-1B6A-4E05-B6F4-5FA2435738BE}.Release|Any CPU.Build.0 = Release|Any CPU - {0A91A2DA-6490-4EE5-AA0F-1B055966830C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0A91A2DA-6490-4EE5-AA0F-1B055966830C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0A91A2DA-6490-4EE5-AA0F-1B055966830C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A91A2DA-6490-4EE5-AA0F-1B055966830C}.Release|Any CPU.Build.0 = Release|Any CPU - {FA89943C-FD8E-42C5-A2F9-23C58952C0D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA89943C-FD8E-42C5-A2F9-23C58952C0D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA89943C-FD8E-42C5-A2F9-23C58952C0D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA89943C-FD8E-42C5-A2F9-23C58952C0D9}.Release|Any CPU.Build.0 = Release|Any CPU - {5E26550D-8556-425E-99B9-9E932B931E2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5E26550D-8556-425E-99B9-9E932B931E2C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5E26550D-8556-425E-99B9-9E932B931E2C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5E26550D-8556-425E-99B9-9E932B931E2C}.Release|Any CPU.Build.0 = Release|Any CPU - {50715692-EE4A-4DE9-BA64-3226C20E7EFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {50715692-EE4A-4DE9-BA64-3226C20E7EFD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {50715692-EE4A-4DE9-BA64-3226C20E7EFD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {50715692-EE4A-4DE9-BA64-3226C20E7EFD}.Release|Any CPU.Build.0 = Release|Any CPU - {50657568-23CD-4307-AB2E-86A3B03ECB01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {50657568-23CD-4307-AB2E-86A3B03ECB01}.Debug|Any CPU.Build.0 = Debug|Any CPU - {50657568-23CD-4307-AB2E-86A3B03ECB01}.Release|Any CPU.ActiveCfg = Release|Any CPU - {50657568-23CD-4307-AB2E-86A3B03ECB01}.Release|Any CPU.Build.0 = Release|Any CPU - {E9414ABB-3845-47C8-96AA-BAA4FEC51B7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9414ABB-3845-47C8-96AA-BAA4FEC51B7E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9414ABB-3845-47C8-96AA-BAA4FEC51B7E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9414ABB-3845-47C8-96AA-BAA4FEC51B7E}.Release|Any CPU.Build.0 = Release|Any CPU - {51E8C5A1-9789-4619-8ACE-D25DB5460413}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {51E8C5A1-9789-4619-8ACE-D25DB5460413}.Debug|Any CPU.Build.0 = Debug|Any CPU - {51E8C5A1-9789-4619-8ACE-D25DB5460413}.Release|Any CPU.ActiveCfg = Release|Any CPU - {51E8C5A1-9789-4619-8ACE-D25DB5460413}.Release|Any CPU.Build.0 = Release|Any CPU - {88921AF0-2327-4E02-A9FE-201C37670C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88921AF0-2327-4E02-A9FE-201C37670C01}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88921AF0-2327-4E02-A9FE-201C37670C01}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88921AF0-2327-4E02-A9FE-201C37670C01}.Release|Any CPU.Build.0 = Release|Any CPU - {658DFE92-7D9E-4DD6-979C-57460629A5E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {658DFE92-7D9E-4DD6-979C-57460629A5E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {658DFE92-7D9E-4DD6-979C-57460629A5E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {658DFE92-7D9E-4DD6-979C-57460629A5E2}.Release|Any CPU.Build.0 = Release|Any CPU - {AD006E83-4501-47B5-BEEA-BA9326A3D630}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD006E83-4501-47B5-BEEA-BA9326A3D630}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD006E83-4501-47B5-BEEA-BA9326A3D630}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD006E83-4501-47B5-BEEA-BA9326A3D630}.Release|Any CPU.Build.0 = Release|Any CPU - {7299B336-9340-4E15-B0EE-B59C2770D7EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7299B336-9340-4E15-B0EE-B59C2770D7EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7299B336-9340-4E15-B0EE-B59C2770D7EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7299B336-9340-4E15-B0EE-B59C2770D7EE}.Release|Any CPU.Build.0 = Release|Any CPU - {6E92E509-834F-403C-A0B0-3B691F3C816D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E92E509-834F-403C-A0B0-3B691F3C816D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E92E509-834F-403C-A0B0-3B691F3C816D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E92E509-834F-403C-A0B0-3B691F3C816D}.Release|Any CPU.Build.0 = Release|Any CPU - {382B91E4-9043-4261-BBE7-BEA9C0137C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {382B91E4-9043-4261-BBE7-BEA9C0137C07}.Debug|Any CPU.Build.0 = Debug|Any CPU - {382B91E4-9043-4261-BBE7-BEA9C0137C07}.Release|Any CPU.ActiveCfg = Release|Any CPU - {382B91E4-9043-4261-BBE7-BEA9C0137C07}.Release|Any CPU.Build.0 = Release|Any CPU - {F7185339-B401-483F-8FB5-FBC9A1D4DBFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F7185339-B401-483F-8FB5-FBC9A1D4DBFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F7185339-B401-483F-8FB5-FBC9A1D4DBFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F7185339-B401-483F-8FB5-FBC9A1D4DBFC}.Release|Any CPU.Build.0 = Release|Any CPU - {4719C295-752C-4464-8A7D-151A1B8A37DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4719C295-752C-4464-8A7D-151A1B8A37DD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4719C295-752C-4464-8A7D-151A1B8A37DD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4719C295-752C-4464-8A7D-151A1B8A37DD}.Release|Any CPU.Build.0 = Release|Any CPU - {C4535DDC-D848-4238-B99D-ED0C9767D64C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C4535DDC-D848-4238-B99D-ED0C9767D64C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C4535DDC-D848-4238-B99D-ED0C9767D64C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C4535DDC-D848-4238-B99D-ED0C9767D64C}.Release|Any CPU.Build.0 = Release|Any CPU - {AD45E9C7-D739-4513-8F01-3A6826E0F4FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD45E9C7-D739-4513-8F01-3A6826E0F4FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD45E9C7-D739-4513-8F01-3A6826E0F4FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD45E9C7-D739-4513-8F01-3A6826E0F4FA}.Release|Any CPU.Build.0 = Release|Any CPU - {E0B6EFF9-41D8-4EDF-8303-5977D6637FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0B6EFF9-41D8-4EDF-8303-5977D6637FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0B6EFF9-41D8-4EDF-8303-5977D6637FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0B6EFF9-41D8-4EDF-8303-5977D6637FF6}.Release|Any CPU.Build.0 = Release|Any CPU - {FF280BA1-B772-48AC-8110-065520F3B852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF280BA1-B772-48AC-8110-065520F3B852}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF280BA1-B772-48AC-8110-065520F3B852}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF280BA1-B772-48AC-8110-065520F3B852}.Release|Any CPU.Build.0 = Release|Any CPU - {EA1FCF65-B230-4932-9164-85C2E39449BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA1FCF65-B230-4932-9164-85C2E39449BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA1FCF65-B230-4932-9164-85C2E39449BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA1FCF65-B230-4932-9164-85C2E39449BC}.Release|Any CPU.Build.0 = Release|Any CPU - {1F34FA6D-124F-42AD-BE5F-F31FF07B9E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F34FA6D-124F-42AD-BE5F-F31FF07B9E28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F34FA6D-124F-42AD-BE5F-F31FF07B9E28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F34FA6D-124F-42AD-BE5F-F31FF07B9E28}.Release|Any CPU.Build.0 = Release|Any CPU - {0DCC0BF3-FDFF-4AF7-A080-6A5D9213386F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DCC0BF3-FDFF-4AF7-A080-6A5D9213386F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DCC0BF3-FDFF-4AF7-A080-6A5D9213386F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DCC0BF3-FDFF-4AF7-A080-6A5D9213386F}.Release|Any CPU.Build.0 = Release|Any CPU - {614740C2-6A5E-4F93-BD55-C3DF9B7EF33F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {614740C2-6A5E-4F93-BD55-C3DF9B7EF33F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {614740C2-6A5E-4F93-BD55-C3DF9B7EF33F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {614740C2-6A5E-4F93-BD55-C3DF9B7EF33F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {AF835CF7-F63E-4667-A84D-298D4FF2E095} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {1388F723-B25D-4020-8F5B-B7A4B2BD067F} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {C5868FAC-1628-4400-8018-7DD14E4A6119} = {1388F723-B25D-4020-8F5B-B7A4B2BD067F} - {6AB76071-4AF2-49EF-ACDC-3F5EEBC73958} = {1388F723-B25D-4020-8F5B-B7A4B2BD067F} - {EA678579-BA95-403B-A700-5878CD3A13DD} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {1194D255-B8CE-4268-B5EA-8EB36A3A758F} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {0480A21D-4A63-4372-9AE1-77D60B56FB46} = {1194D255-B8CE-4268-B5EA-8EB36A3A758F} - {64526710-CEFE-40C7-AA39-B2A1A87FF203} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {AA74E944-135B-4227-9C3C-ECD46406B1A4} = {64526710-CEFE-40C7-AA39-B2A1A87FF203} - {1B87270E-1B6A-4E05-B6F4-5FA2435738BE} = {AA74E944-135B-4227-9C3C-ECD46406B1A4} - {163CC013-E841-49A8-8A62-68B467683CE6} = {64526710-CEFE-40C7-AA39-B2A1A87FF203} - {0A91A2DA-6490-4EE5-AA0F-1B055966830C} = {163CC013-E841-49A8-8A62-68B467683CE6} - {FAA54A28-B96D-494F-87CB-E823160D262D} = {64526710-CEFE-40C7-AA39-B2A1A87FF203} - {FA89943C-FD8E-42C5-A2F9-23C58952C0D9} = {FAA54A28-B96D-494F-87CB-E823160D262D} - {5F662200-07DC-4221-843C-AEAE137E4B96} = {64526710-CEFE-40C7-AA39-B2A1A87FF203} - {5E26550D-8556-425E-99B9-9E932B931E2C} = {5F662200-07DC-4221-843C-AEAE137E4B96} - {A3F73601-24CF-4396-B688-EA53EF91A4D4} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {50715692-EE4A-4DE9-BA64-3226C20E7EFD} = {A3F73601-24CF-4396-B688-EA53EF91A4D4} - {50657568-23CD-4307-AB2E-86A3B03ECB01} = {EA678579-BA95-403B-A700-5878CD3A13DD} - {1B4C5600-1E5A-4797-B675-C459C7FB5454} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {F93CB7AF-CA43-4D1E-883F-EEB4930FC679} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {E9414ABB-3845-47C8-96AA-BAA4FEC51B7E} = {F93CB7AF-CA43-4D1E-883F-EEB4930FC679} - {51E8C5A1-9789-4619-8ACE-D25DB5460413} = {1B4C5600-1E5A-4797-B675-C459C7FB5454} - {3892B517-E16C-4BDB-8EE0-CB80F66C3B19} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {88921AF0-2327-4E02-A9FE-201C37670C01} = {3892B517-E16C-4BDB-8EE0-CB80F66C3B19} - {1D0A109B-6458-4C04-B400-F9484310595C} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {658DFE92-7D9E-4DD6-979C-57460629A5E2} = {1D0A109B-6458-4C04-B400-F9484310595C} - {8D3DAA2C-A035-47DC-92DE-A0DA501B32BF} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {A6FDF528-DB3B-4838-8D9D-F3E0F08DF97A} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {AD006E83-4501-47B5-BEEA-BA9326A3D630} = {A6FDF528-DB3B-4838-8D9D-F3E0F08DF97A} - {7299B336-9340-4E15-B0EE-B59C2770D7EE} = {8D3DAA2C-A035-47DC-92DE-A0DA501B32BF} - {32202E5E-02C2-48CA-9D8D-687146EB0232} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {6E92E509-834F-403C-A0B0-3B691F3C816D} = {32202E5E-02C2-48CA-9D8D-687146EB0232} - {1828D64E-F976-4B87-B37C-BD9E694E9482} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {382B91E4-9043-4261-BBE7-BEA9C0137C07} = {1828D64E-F976-4B87-B37C-BD9E694E9482} - {F7185339-B401-483F-8FB5-FBC9A1D4DBFC} = {AF835CF7-F63E-4667-A84D-298D4FF2E095} - {8E574EE1-3694-4905-B0FA-BEE599B5C0F9} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {4719C295-752C-4464-8A7D-151A1B8A37DD} = {8E574EE1-3694-4905-B0FA-BEE599B5C0F9} - {CC39E923-166C-43EB-BD80-6B89122CF7A5} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {C4535DDC-D848-4238-B99D-ED0C9767D64C} = {CC39E923-166C-43EB-BD80-6B89122CF7A5} - {5EFD2336-9236-4C29-9CFD-077E702D6ACD} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {AD45E9C7-D739-4513-8F01-3A6826E0F4FA} = {5EFD2336-9236-4C29-9CFD-077E702D6ACD} - {5771998F-DD44-4CEA-8B37-C2E90E5014AC} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {E0B6EFF9-41D8-4EDF-8303-5977D6637FF6} = {5771998F-DD44-4CEA-8B37-C2E90E5014AC} - {6EAC4719-E994-426D-87BD-6BB12FF17232} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {FF280BA1-B772-48AC-8110-065520F3B852} = {6EAC4719-E994-426D-87BD-6BB12FF17232} - {EA1FCF65-B230-4932-9164-85C2E39449BC} = {6EAC4719-E994-426D-87BD-6BB12FF17232} - {1F34FA6D-124F-42AD-BE5F-F31FF07B9E28} = {6EAC4719-E994-426D-87BD-6BB12FF17232} - {0DCC0BF3-FDFF-4AF7-A080-6A5D9213386F} = {6EAC4719-E994-426D-87BD-6BB12FF17232} - {9F730981-E25D-4857-B870-B98B0398688B} = {E148C898-1BFD-4F28-8940-583CC50F90DB} - {614740C2-6A5E-4F93-BD55-C3DF9B7EF33F} = {9F730981-E25D-4857-B870-B98B0398688B} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {ECEAECE7-49E5-4CBC-B84D-5FF82F2399FC} - EndGlobalSection -EndGlobal diff --git a/learn-dotnet.slnx b/learn-dotnet.slnx new file mode 100644 index 0000000..faf2e23 --- /dev/null +++ b/learn-dotnet.slnx @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/localization/Localization/Localization.csproj b/localization/Localization/Localization.csproj index 34a4e91..57b18e6 100644 --- a/localization/Localization/Localization.csproj +++ b/localization/Localization/Localization.csproj @@ -5,7 +5,6 @@ - diff --git a/model-binders/ModelBinders/IQuery.cs b/model-binders/ModelBinders/IQuery.cs index b5f0f58..ab0c2c2 100644 --- a/model-binders/ModelBinders/IQuery.cs +++ b/model-binders/ModelBinders/IQuery.cs @@ -1,5 +1,3 @@ namespace ModelBinders; -public interface IQuery : IDictionary -{ -} \ No newline at end of file +public interface IQuery : IDictionary; \ No newline at end of file diff --git a/model-binders/ModelBinders/ModelOne.cs b/model-binders/ModelBinders/ModelOne.cs index 12d3181..f355afd 100644 --- a/model-binders/ModelBinders/ModelOne.cs +++ b/model-binders/ModelBinders/ModelOne.cs @@ -6,6 +6,4 @@ public class ModelOne(Guid _id, string _name) public string Name => _name; } -public class ModelOnes : Dictionary, IQuery -{ -} \ No newline at end of file +public class ModelOnes : Dictionary, IQuery; \ No newline at end of file diff --git a/model-binders/ModelBinders/ModelTwo.cs b/model-binders/ModelBinders/ModelTwo.cs index 942186f..823054c 100644 --- a/model-binders/ModelBinders/ModelTwo.cs +++ b/model-binders/ModelBinders/ModelTwo.cs @@ -6,6 +6,4 @@ public class ModelTwo(Guid _id, string _name) public string Name => _name; } -public class ModelTwos : Dictionary, IQuery -{ -} \ No newline at end of file +public class ModelTwos : Dictionary, IQuery; \ No newline at end of file diff --git a/swashbuckle/Swashbuckle/AddParameterToPostOperations.cs b/swashbuckle/Swashbuckle/AddParameterToPostOperations.cs index a54a3c9..a1f7777 100644 --- a/swashbuckle/Swashbuckle/AddParameterToPostOperations.cs +++ b/swashbuckle/Swashbuckle/AddParameterToPostOperations.cs @@ -1,4 +1,4 @@ -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace Swashbuckle; @@ -10,7 +10,8 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) { if (context.ApiDescription.HttpMethod != "POST") { return; } - operation.Parameters.Insert(0, new() + operation.Parameters ??= []; + operation.Parameters.Insert(0, new OpenApiParameter { In = _in, Name = _name, diff --git a/swashbuckle/Swashbuckle/DocumentBasedSecurityDefinition.cs b/swashbuckle/Swashbuckle/DocumentBasedSecurityDefinition.cs index afe4910..c210166 100644 --- a/swashbuckle/Swashbuckle/DocumentBasedSecurityDefinition.cs +++ b/swashbuckle/Swashbuckle/DocumentBasedSecurityDefinition.cs @@ -1,4 +1,4 @@ -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace Swashbuckle; @@ -10,6 +10,9 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) { if (context.DocumentName != document) { return; } + swaggerDoc.Components ??= new OpenApiComponents(); + swaggerDoc.Components.SecuritySchemes ??= new Dictionary(); + swaggerDoc.Components.SecuritySchemes[_schemeId] = _scheme; } } \ No newline at end of file diff --git a/swashbuckle/Swashbuckle/DocumentBasedSecurityRequirement.cs b/swashbuckle/Swashbuckle/DocumentBasedSecurityRequirement.cs index 18e6d00..ec4b961 100644 --- a/swashbuckle/Swashbuckle/DocumentBasedSecurityRequirement.cs +++ b/swashbuckle/Swashbuckle/DocumentBasedSecurityRequirement.cs @@ -1,4 +1,4 @@ -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace Swashbuckle; @@ -10,12 +10,11 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) { if (context.DocumentName != _document) { return; } + operation.Security ??= []; operation.Security.Add(new() - { { - new() { Reference = new() { Type = ReferenceType.SecurityScheme, Id = _schemeId } }, - Array.Empty() + { new OpenApiSecuritySchemeReference(_schemeId), [] }, } - }); + ); } } \ No newline at end of file diff --git a/swashbuckle/Swashbuckle/Program.cs b/swashbuckle/Swashbuckle/Program.cs index 15e64df..73b2b65 100644 --- a/swashbuckle/Swashbuckle/Program.cs +++ b/swashbuckle/Swashbuckle/Program.cs @@ -1,4 +1,4 @@ -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle; using Swashbuckle.AspNetCore.SwaggerGen; @@ -22,11 +22,8 @@ // custom metadata swaggerGenOptions.DocInclusionPredicate((document, api) => - // doc exclusion - !api.CustomAttributes().OfType().Any() && - - // multi doc - api.CustomAttributes().OfType().SingleOrDefault()?.Name == document + !api.CustomAttributes().OfType().Any() && // doc exclusion + api.CustomAttributes().OfType().SingleOrDefault()?.Name == document // multi doc ); // security config diff --git a/swashbuckle/Swashbuckle/Swashbuckle.csproj b/swashbuckle/Swashbuckle/Swashbuckle.csproj index 2d70ad3..a3b6c2d 100644 --- a/swashbuckle/Swashbuckle/Swashbuckle.csproj +++ b/swashbuckle/Swashbuckle/Swashbuckle.csproj @@ -1,6 +1,7 @@ + diff --git a/unit-testing/UnitTesting/UnitTesting.csproj b/unit-testing/UnitTesting/UnitTesting.csproj index 89f79ba..56d1cd7 100644 --- a/unit-testing/UnitTesting/UnitTesting.csproj +++ b/unit-testing/UnitTesting/UnitTesting.csproj @@ -1,6 +1,7 @@ + Exe false true @@ -8,6 +9,8 @@ + + @@ -15,10 +18,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive -