From c4bb2f02baaaff2439a47a97029e52d0b2afcfd9 Mon Sep 17 00:00:00 2001 From: James Thompson Date: Sat, 20 Apr 2024 09:29:38 +1000 Subject: [PATCH 1/2] #275 Add in Net 6 to optimize dependencies --- .../CacheTower.Serializers.SystemTextJson.csproj | 4 ++-- src/CacheTower/CacheTower.csproj | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj b/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj index 3496c09..61024dd 100644 --- a/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj +++ b/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj @@ -1,14 +1,14 @@  - netstandard2.0 + netstandard2.0;net6.0 System.Text.Json Serializer for Cache Tower System.Text.Json cache serialization for Cache Tower system.text.json;json;$(PackageBaseTags) James Turner - + diff --git a/src/CacheTower/CacheTower.csproj b/src/CacheTower/CacheTower.csproj index 10266fb..ec3f147 100644 --- a/src/CacheTower/CacheTower.csproj +++ b/src/CacheTower/CacheTower.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netstandard2.1 + netstandard2.0;netstandard2.1;net6.0 Cache Tower A multi-layered caching system for .NET inmemory,$(PackageBaseTags) @@ -13,7 +13,13 @@ - + + + + + + + @@ -21,5 +27,5 @@ - + From 3c9e79a2c42bb11202cb75f530d6c733a9cb0bbf Mon Sep 17 00:00:00 2001 From: James Thompson Date: Wed, 5 Jun 2024 13:34:54 +1000 Subject: [PATCH 2/2] Fix build issue --- .../CacheTower.Serializers.SystemTextJson.csproj | 2 +- src/CacheTower/Internal/CacheEntryKeyLock.cs | 4 ++-- src/CacheTower/Internal/MD5HashUtility.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj b/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj index 61024dd..6f253d7 100644 --- a/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj +++ b/src/CacheTower.Serializers.SystemTextJson/CacheTower.Serializers.SystemTextJson.csproj @@ -8,7 +8,7 @@ James Turner - + diff --git a/src/CacheTower/Internal/CacheEntryKeyLock.cs b/src/CacheTower/Internal/CacheEntryKeyLock.cs index 6228738..fdcb049 100644 --- a/src/CacheTower/Internal/CacheEntryKeyLock.cs +++ b/src/CacheTower/Internal/CacheEntryKeyLock.cs @@ -22,7 +22,7 @@ public bool AcquireLock(string cacheKey) keyLocks[cacheKey] = null; } return hasLock; -#elif NETSTANDARD2_1 +#else return keyLocks.TryAdd(cacheKey, null); #endif } @@ -56,7 +56,7 @@ private bool TryRemove(string cacheKey, out TaskCompletionSource? c return true; } return false; -#elif NETSTANDARD2_1 +#else return keyLocks.Remove(cacheKey, out completionSource); #endif } diff --git a/src/CacheTower/Internal/MD5HashUtility.cs b/src/CacheTower/Internal/MD5HashUtility.cs index ff33d6b..c5bc487 100644 --- a/src/CacheTower/Internal/MD5HashUtility.cs +++ b/src/CacheTower/Internal/MD5HashUtility.cs @@ -17,7 +17,7 @@ public static unsafe string ComputeHash(string value) var bytes = Encoding.UTF8.GetBytes(value); var hashBytes = HashAlgorithm.ComputeHash(bytes); -#elif NETSTANDARD2_1 +#else public static unsafe string ComputeHash(ReadOnlySpan value) { var encoding = Encoding.UTF8;