diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f1ee9e..db7c69c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 10.0.x - name: Restore dependencies run: dotnet restore CommandQuery.sln diff --git a/Analyzers.props b/Analyzers.props index 04feb23..1567329 100644 --- a/Analyzers.props +++ b/Analyzers.props @@ -12,11 +12,11 @@ - + all runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Directory.Build.props b/Directory.Build.props index 47228a9..fbd84a8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,7 +16,10 @@ - + + all + runtime; build; native; contentfiles; analyzers + diff --git a/Tests.props b/Tests.props new file mode 100644 index 0000000..7dc79ed --- /dev/null +++ b/Tests.props @@ -0,0 +1,25 @@ + + + + disable + false + true + $(NoWarn);CS1998;CS8321;NU1504;NU1603;Moq1203;Moq1400 + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/src/CommandQuery.AWSLambda/CommandQuery.AWSLambda.csproj b/src/CommandQuery.AWSLambda/CommandQuery.AWSLambda.csproj index 2e1800c..32370f2 100644 --- a/src/CommandQuery.AWSLambda/CommandQuery.AWSLambda.csproj +++ b/src/CommandQuery.AWSLambda/CommandQuery.AWSLambda.csproj @@ -37,8 +37,8 @@ - - + + diff --git a/src/CommandQuery.AspNetCore/CommandQuery.AspNetCore.csproj b/src/CommandQuery.AspNetCore/CommandQuery.AspNetCore.csproj index bb55207..f046eec 100644 --- a/src/CommandQuery.AspNetCore/CommandQuery.AspNetCore.csproj +++ b/src/CommandQuery.AspNetCore/CommandQuery.AspNetCore.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 4.0.0 - Change TargetFramework to net8.0 diff --git a/src/CommandQuery.AspNetCore/CommandWithResultController.cs b/src/CommandQuery.AspNetCore/CommandWithResultController.cs index 91d76bf..495bf02 100644 --- a/src/CommandQuery.AspNetCore/CommandWithResultController.cs +++ b/src/CommandQuery.AspNetCore/CommandWithResultController.cs @@ -33,7 +33,10 @@ public CommandController(ICommandProcessor commandProcessor, ILogger HandleAsync(TCommand command, CancellationToken cancellationToken) { - _logger.LogInformation("Handle {@Command}", command); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {@Command}", command); + } try { diff --git a/src/CommandQuery.AspNetCore/CommandWithoutResultController.cs b/src/CommandQuery.AspNetCore/CommandWithoutResultController.cs index ce37ff7..4a991d4 100644 --- a/src/CommandQuery.AspNetCore/CommandWithoutResultController.cs +++ b/src/CommandQuery.AspNetCore/CommandWithoutResultController.cs @@ -33,7 +33,10 @@ public CommandController(ICommandProcessor commandProcessor, ILogger HandleAsync(TCommand command, CancellationToken cancellationToken) { - _logger.LogInformation("Handle {@Command}", command); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {@Command}", command); + } try { diff --git a/src/CommandQuery.AspNetCore/QueryController.cs b/src/CommandQuery.AspNetCore/QueryController.cs index 65b867c..5c8e478 100644 --- a/src/CommandQuery.AspNetCore/QueryController.cs +++ b/src/CommandQuery.AspNetCore/QueryController.cs @@ -34,7 +34,10 @@ public QueryController(IQueryProcessor queryProcessor, ILogger HandlePostAsync(TQuery query, CancellationToken cancellationToken) { - _logger.LogInformation("Handle {@Query}", query); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {@Query}", query); + } try { @@ -59,7 +62,10 @@ public async Task HandlePostAsync(TQuery query, CancellationToken [HttpGet] public async Task HandleGetAsync([FromQuery] TQuery query, CancellationToken cancellationToken) { - _logger.LogInformation("Handle {@Query}", query); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {@Query}", query); + } try { diff --git a/src/CommandQuery.AzureFunctions/CommandFunction.cs b/src/CommandQuery.AzureFunctions/CommandFunction.cs index 26075c5..e916004 100644 --- a/src/CommandQuery.AzureFunctions/CommandFunction.cs +++ b/src/CommandQuery.AzureFunctions/CommandFunction.cs @@ -33,7 +33,10 @@ public async Task HandleAsync(string commandName, HttpRequestD { ArgumentNullException.ThrowIfNull(req); - _logger.LogInformation("Handle {Command}", commandName); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {Command}", commandName); + } try { @@ -62,7 +65,10 @@ public async Task HandleAsync(string commandName, HttpRequest req { ArgumentNullException.ThrowIfNull(req); - _logger.LogInformation("Handle {Command}", commandName); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {Command}", commandName); + } try { diff --git a/src/CommandQuery.AzureFunctions/CommandQuery.AzureFunctions.csproj b/src/CommandQuery.AzureFunctions/CommandQuery.AzureFunctions.csproj index c96ae45..c07f648 100644 --- a/src/CommandQuery.AzureFunctions/CommandQuery.AzureFunctions.csproj +++ b/src/CommandQuery.AzureFunctions/CommandQuery.AzureFunctions.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 4.0.0 - Change TargetFramework to net8.0 @@ -38,7 +38,7 @@ - + diff --git a/src/CommandQuery.AzureFunctions/QueryFunction.cs b/src/CommandQuery.AzureFunctions/QueryFunction.cs index cd00abb..6f732b5 100644 --- a/src/CommandQuery.AzureFunctions/QueryFunction.cs +++ b/src/CommandQuery.AzureFunctions/QueryFunction.cs @@ -34,7 +34,10 @@ public async Task HandleAsync(string queryName, HttpRequestDat { ArgumentNullException.ThrowIfNull(req); - _logger.LogInformation("Handle {Query}", queryName); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {Query}", queryName); + } try { @@ -67,7 +70,10 @@ public async Task HandleAsync(string queryName, HttpRequest req, { ArgumentNullException.ThrowIfNull(req); - _logger.LogInformation("Handle {Query}", queryName); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Handle {Query}", queryName); + } try { diff --git a/src/CommandQuery.Client/CommandQuery.Client.csproj b/src/CommandQuery.Client/CommandQuery.Client.csproj index bd9bde1..48f059a 100644 --- a/src/CommandQuery.Client/CommandQuery.Client.csproj +++ b/src/CommandQuery.Client/CommandQuery.Client.csproj @@ -34,7 +34,7 @@ - + diff --git a/src/CommandQuery.GoogleCloudFunctions/CommandQuery.GoogleCloudFunctions.csproj b/src/CommandQuery.GoogleCloudFunctions/CommandQuery.GoogleCloudFunctions.csproj index a3ccbc7..4a801db 100644 --- a/src/CommandQuery.GoogleCloudFunctions/CommandQuery.GoogleCloudFunctions.csproj +++ b/src/CommandQuery.GoogleCloudFunctions/CommandQuery.GoogleCloudFunctions.csproj @@ -36,8 +36,8 @@ - - + + diff --git a/src/CommandQuery.SystemTextJson/CommandQuery.SystemTextJson.csproj b/src/CommandQuery.SystemTextJson/CommandQuery.SystemTextJson.csproj index 8d744a2..eefcae0 100644 --- a/src/CommandQuery.SystemTextJson/CommandQuery.SystemTextJson.csproj +++ b/src/CommandQuery.SystemTextJson/CommandQuery.SystemTextJson.csproj @@ -29,7 +29,7 @@ - + diff --git a/src/CommandQuery/CommandQuery.csproj b/src/CommandQuery/CommandQuery.csproj index 6affa7b..168c0fe 100644 --- a/src/CommandQuery/CommandQuery.csproj +++ b/src/CommandQuery/CommandQuery.csproj @@ -41,7 +41,7 @@ - + diff --git a/tests/CommandQuery.AWSLambda.Tests/CommandQuery.AWSLambda.Tests.csproj b/tests/CommandQuery.AWSLambda.Tests/CommandQuery.AWSLambda.Tests.csproj index dc0d8dd..7cf075b 100644 --- a/tests/CommandQuery.AWSLambda.Tests/CommandQuery.AWSLambda.Tests.csproj +++ b/tests/CommandQuery.AWSLambda.Tests/CommandQuery.AWSLambda.Tests.csproj @@ -1,29 +1,15 @@ + + - net8.0 - disable - false - true - $(NoWarn);CS1998;CS8321;NU1603 + net10.0 - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/tests/CommandQuery.AspNetCore.Tests/CommandQuery.AspNetCore.Tests.csproj b/tests/CommandQuery.AspNetCore.Tests/CommandQuery.AspNetCore.Tests.csproj index adf62c6..257f4cc 100644 --- a/tests/CommandQuery.AspNetCore.Tests/CommandQuery.AspNetCore.Tests.csproj +++ b/tests/CommandQuery.AspNetCore.Tests/CommandQuery.AspNetCore.Tests.csproj @@ -1,29 +1,15 @@ + + - net8.0 - disable - false - true - $(NoWarn);CS1998;CS8321;NU1603 + net10.0 - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/tests/CommandQuery.AzureFunctions.Tests/CommandQuery.AzureFunctions.Tests.csproj b/tests/CommandQuery.AzureFunctions.Tests/CommandQuery.AzureFunctions.Tests.csproj index 20aca45..d73d3ca 100644 --- a/tests/CommandQuery.AzureFunctions.Tests/CommandQuery.AzureFunctions.Tests.csproj +++ b/tests/CommandQuery.AzureFunctions.Tests/CommandQuery.AzureFunctions.Tests.csproj @@ -1,29 +1,15 @@ + + - net8.0 - disable - false - true - $(NoWarn);CS1998;CS8321;NU1603 + net10.0 - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/tests/CommandQuery.Benchmark/CommandQuery.Benchmark.csproj b/tests/CommandQuery.Benchmark/CommandQuery.Benchmark.csproj index 2322825..6d3468c 100644 --- a/tests/CommandQuery.Benchmark/CommandQuery.Benchmark.csproj +++ b/tests/CommandQuery.Benchmark/CommandQuery.Benchmark.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 Exe disable @@ -17,8 +17,8 @@ - - + + diff --git a/tests/CommandQuery.GoogleCloudFunctions.Tests/CommandQuery.GoogleCloudFunctions.Tests.csproj b/tests/CommandQuery.GoogleCloudFunctions.Tests/CommandQuery.GoogleCloudFunctions.Tests.csproj index 39eb980..3476cb7 100644 --- a/tests/CommandQuery.GoogleCloudFunctions.Tests/CommandQuery.GoogleCloudFunctions.Tests.csproj +++ b/tests/CommandQuery.GoogleCloudFunctions.Tests/CommandQuery.GoogleCloudFunctions.Tests.csproj @@ -1,11 +1,9 @@ + + - net8.0 - disable - false - true - $(NoWarn);CS1998;CS8321;NU1603 + net10.0 @@ -13,17 +11,8 @@ - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/tests/CommandQuery.Tests/CommandQuery.Tests.csproj b/tests/CommandQuery.Tests/CommandQuery.Tests.csproj index 2bfdbbc..07b67f3 100644 --- a/tests/CommandQuery.Tests/CommandQuery.Tests.csproj +++ b/tests/CommandQuery.Tests/CommandQuery.Tests.csproj @@ -1,25 +1,11 @@ + + - net8.0 - disable - false - true - $(NoWarn);CS1998;CS8321;NU1603 + net10.0 - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - -