From ad3aca158900fd5875e9bb96a546d51a03c8d8f4 Mon Sep 17 00:00:00 2001 From: Kambiz Khojasteh Date: Sat, 15 Nov 2025 16:52:59 +0800 Subject: [PATCH 1/3] Bump version to 2.4.0 and update dependencies Updated all project versions from 2.3.2 to 2.4.0 to indicate a new release. Upgraded `System.Text.Json` in `Kampute.HttpClient.Json.csproj` from 8.0.6 to 10.0.0. Upgraded `Newtonsoft.Json` in `Kampute.HttpClient.NewtonsoftJson.csproj` from 13.0.3 to 13.0.4. These updates ensure compatibility with newer dependencies and maintain alignment across all Kampute.HttpClient-related packages. --- .../Kampute.HttpClient.DataContract.csproj | 2 +- src/Kampute.HttpClient.Json/Kampute.HttpClient.Json.csproj | 4 ++-- .../Kampute.HttpClient.NewtonsoftJson.csproj | 4 ++-- src/Kampute.HttpClient.Xml/Kampute.HttpClient.Xml.csproj | 2 +- src/Kampute.HttpClient/Kampute.HttpClient.csproj | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Kampute.HttpClient.DataContract/Kampute.HttpClient.DataContract.csproj b/src/Kampute.HttpClient.DataContract/Kampute.HttpClient.DataContract.csproj index 49f2bf2..d2d3320 100644 --- a/src/Kampute.HttpClient.DataContract/Kampute.HttpClient.DataContract.csproj +++ b/src/Kampute.HttpClient.DataContract/Kampute.HttpClient.DataContract.csproj @@ -5,7 +5,7 @@ Kampute.HttpClient.DataContract This package is an extension package for Kampute.HttpClient, enhancing it to manage application/xml content types, using DataContractSerializer for serialization and deserialization of XML responses and payloads. Kambiz Khojasteh - 2.3.2 + 2.4.0 Kampute Copyright (c) 2024 Kampute latest diff --git a/src/Kampute.HttpClient.Json/Kampute.HttpClient.Json.csproj b/src/Kampute.HttpClient.Json/Kampute.HttpClient.Json.csproj index 6806861..6fdaa68 100644 --- a/src/Kampute.HttpClient.Json/Kampute.HttpClient.Json.csproj +++ b/src/Kampute.HttpClient.Json/Kampute.HttpClient.Json.csproj @@ -5,7 +5,7 @@ Kampute.HttpClient.Json This package is an extension package for Kampute.HttpClient, enhancing it to manage application/json content types, using System.Text.Json library for serialization and deserialization of JSON responses and payloads. Kambiz Khojasteh - 2.3.2 + 2.4.0 Kampute Copyright (c) 2024 Kampute latest @@ -36,7 +36,7 @@ - + diff --git a/src/Kampute.HttpClient.NewtonsoftJson/Kampute.HttpClient.NewtonsoftJson.csproj b/src/Kampute.HttpClient.NewtonsoftJson/Kampute.HttpClient.NewtonsoftJson.csproj index 240db10..5d3f663 100644 --- a/src/Kampute.HttpClient.NewtonsoftJson/Kampute.HttpClient.NewtonsoftJson.csproj +++ b/src/Kampute.HttpClient.NewtonsoftJson/Kampute.HttpClient.NewtonsoftJson.csproj @@ -5,7 +5,7 @@ Kampute.HttpClient.NewtonsoftJson This package is an extension package for Kampute.HttpClient, enhancing it to manage application/json content types, using Newtonsoft.Json library for serialization and deserialization of JSON responses and payloads. Kambiz Khojasteh - 2.3.2 + 2.4.0 Kampute Copyright (c) 2024 Kampute latest @@ -36,7 +36,7 @@ - + diff --git a/src/Kampute.HttpClient.Xml/Kampute.HttpClient.Xml.csproj b/src/Kampute.HttpClient.Xml/Kampute.HttpClient.Xml.csproj index 30949cc..3bacaad 100644 --- a/src/Kampute.HttpClient.Xml/Kampute.HttpClient.Xml.csproj +++ b/src/Kampute.HttpClient.Xml/Kampute.HttpClient.Xml.csproj @@ -5,7 +5,7 @@ Kampute.HttpClient.Xml This package is an extension package for Kampute.HttpClient, enhancing it to manage application/xml content types, using XmlSerializer for serialization and deserialization of XML responses and payloads. Kambiz Khojasteh - 2.3.2 + 2.4.0 Kampute Copyright (c) 2024 Kampute latest diff --git a/src/Kampute.HttpClient/Kampute.HttpClient.csproj b/src/Kampute.HttpClient/Kampute.HttpClient.csproj index 8f3bd6e..6f0139b 100644 --- a/src/Kampute.HttpClient/Kampute.HttpClient.csproj +++ b/src/Kampute.HttpClient/Kampute.HttpClient.csproj @@ -5,7 +5,7 @@ Kampute.HttpClient Kampute.HttpClient is a versatile and lightweight .NET library that simplifies RESTful API communication. Its core HttpRestClient class provides a streamlined approach to HTTP interactions, offering advanced features such as flexible serialization/deserialization, robust error handling, configurable backoff strategies, and detailed request-response processing. Striking a balance between simplicity and extensibility, Kampute.HttpClient empowers developers with a powerful yet easy-to-use client for seamless API integration across a wide range of .NET applications. Kambiz Khojasteh - 2.3.2 + 2.4.0 Kampute Copyright (c) 2024 Kampute latest From a7522b2923becead797572dfbe47d4495ffd9f71 Mon Sep 17 00:00:00 2001 From: Kambiz Khojasteh Date: Sat, 15 Nov 2025 16:54:01 +0800 Subject: [PATCH 2/3] Update Microsoft.NET.Test.Sdk to version 18.0.1 Upgraded the `Microsoft.NET.Test.Sdk` package from version 18.0.0 to 18.0.1 across the following test project files: - Kampute.HttpClient.DataContract.Test.csproj - Kampute.HttpClient.Json.Test.csproj - Kampute.HttpClient.NewtonsoftJson.Test.csproj - Kampute.HttpClient.Test.csproj - Kampute.HttpClient.Xml.Test.csproj This minor version update likely includes bug fixes, performance improvements, or compatibility enhancements. No other changes were made to dependencies or configurations. --- .../Kampute.HttpClient.DataContract.Test.csproj | 2 +- .../Kampute.HttpClient.Json.Test.csproj | 2 +- .../Kampute.HttpClient.NewtonsoftJson.Test.csproj | 2 +- tests/Kampute.HttpClient.Test/Kampute.HttpClient.Test.csproj | 2 +- .../Kampute.HttpClient.Xml.Test.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Kampute.HttpClient.DataContract.Test/Kampute.HttpClient.DataContract.Test.csproj b/tests/Kampute.HttpClient.DataContract.Test/Kampute.HttpClient.DataContract.Test.csproj index 668c46e..e6eaa33 100644 --- a/tests/Kampute.HttpClient.DataContract.Test/Kampute.HttpClient.DataContract.Test.csproj +++ b/tests/Kampute.HttpClient.DataContract.Test/Kampute.HttpClient.DataContract.Test.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/Kampute.HttpClient.Json.Test/Kampute.HttpClient.Json.Test.csproj b/tests/Kampute.HttpClient.Json.Test/Kampute.HttpClient.Json.Test.csproj index 35c8533..eea2a71 100644 --- a/tests/Kampute.HttpClient.Json.Test/Kampute.HttpClient.Json.Test.csproj +++ b/tests/Kampute.HttpClient.Json.Test/Kampute.HttpClient.Json.Test.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/Kampute.HttpClient.NewtonsoftJson.Test/Kampute.HttpClient.NewtonsoftJson.Test.csproj b/tests/Kampute.HttpClient.NewtonsoftJson.Test/Kampute.HttpClient.NewtonsoftJson.Test.csproj index 71a95d2..97932ca 100644 --- a/tests/Kampute.HttpClient.NewtonsoftJson.Test/Kampute.HttpClient.NewtonsoftJson.Test.csproj +++ b/tests/Kampute.HttpClient.NewtonsoftJson.Test/Kampute.HttpClient.NewtonsoftJson.Test.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/Kampute.HttpClient.Test/Kampute.HttpClient.Test.csproj b/tests/Kampute.HttpClient.Test/Kampute.HttpClient.Test.csproj index 9b7c31b..f0f11e9 100644 --- a/tests/Kampute.HttpClient.Test/Kampute.HttpClient.Test.csproj +++ b/tests/Kampute.HttpClient.Test/Kampute.HttpClient.Test.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/Kampute.HttpClient.Xml.Test/Kampute.HttpClient.Xml.Test.csproj b/tests/Kampute.HttpClient.Xml.Test/Kampute.HttpClient.Xml.Test.csproj index abb1ef8..233ce5d 100644 --- a/tests/Kampute.HttpClient.Xml.Test/Kampute.HttpClient.Xml.Test.csproj +++ b/tests/Kampute.HttpClient.Xml.Test/Kampute.HttpClient.Xml.Test.csproj @@ -10,7 +10,7 @@ - + From 0ae60d346bf9d58fce80041fd88955983ef1e05f Mon Sep 17 00:00:00 2001 From: Kambiz Khojasteh Date: Sat, 15 Nov 2025 16:57:05 +0800 Subject: [PATCH 3/3] Refactor code for consistency Reorganized `using` directives in `IHttpErrorResponse.cs` and `MediaTypeHeaderValueStore.cs` to align with coding conventions. Replaced `int` with `var` in `SharedDisposableTests.cs` for local variables and updated `foreach` loops to use `var` for conciseness. These changes are stylistic and do not affect functionality. --- .../Interfaces/IHttpErrorResponse.cs | 6 +++--- src/Kampute.HttpClient/MediaTypeHeaderValueStore.cs | 5 ++--- .../Utilities/SharedDisposableTests.cs | 10 +++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Kampute.HttpClient/Interfaces/IHttpErrorResponse.cs b/src/Kampute.HttpClient/Interfaces/IHttpErrorResponse.cs index cd1c155..547442e 100644 --- a/src/Kampute.HttpClient/Interfaces/IHttpErrorResponse.cs +++ b/src/Kampute.HttpClient/Interfaces/IHttpErrorResponse.cs @@ -1,12 +1,12 @@ -using System.Net; - -// Copyright (C) 2024 Kampute +// Copyright (C) 2024 Kampute // // This file is part of the Kampute.HttpClient package and is released under the terms of the MIT license. // See the LICENSE file in the project root for the full license text. namespace Kampute.HttpClient.Interfaces { + using System.Net; + /// /// Defines an interface for handling HTTP error responses and converting them into a . /// diff --git a/src/Kampute.HttpClient/MediaTypeHeaderValueStore.cs b/src/Kampute.HttpClient/MediaTypeHeaderValueStore.cs index 1687923..961a9e2 100644 --- a/src/Kampute.HttpClient/MediaTypeHeaderValueStore.cs +++ b/src/Kampute.HttpClient/MediaTypeHeaderValueStore.cs @@ -1,7 +1,6 @@ -using Kampute.HttpClient.Utilities; - -namespace Kampute.HttpClient +namespace Kampute.HttpClient { + using Kampute.HttpClient.Utilities; using System; using System.Net.Http.Headers; diff --git a/tests/Kampute.HttpClient.Test/Utilities/SharedDisposableTests.cs b/tests/Kampute.HttpClient.Test/Utilities/SharedDisposableTests.cs index 938711c..6b50008 100644 --- a/tests/Kampute.HttpClient.Test/Utilities/SharedDisposableTests.cs +++ b/tests/Kampute.HttpClient.Test/Utilities/SharedDisposableTests.cs @@ -78,12 +78,12 @@ public void SharedDisposable_DisposesResource_OnLastRelease() [Test] public void SharedDisposable_MaintainsCorrectReferenceCount_OnConcurrentAcquireAndDispose() { - int numberOfThreads = 100; + var numberOfThreads = 100; var threads = new Thread[numberOfThreads]; - int createdCount = 0; + var createdCount = 0; var sharedDisposable = new SharedDisposable(() => new TestDisposable()); - for (int i = 0; i < numberOfThreads; i++) + for (var i = 0; i < numberOfThreads; i++) { threads[i] = new Thread(() => { @@ -93,10 +93,10 @@ public void SharedDisposable_MaintainsCorrectReferenceCount_OnConcurrentAcquireA }); } - foreach (Thread thread in threads) + foreach (var thread in threads) thread.Start(); - foreach (Thread thread in threads) + foreach (var thread in threads) thread.Join(); Assert.Multiple(() =>