From 026a1e430cd57f770d340341b3bcd657a4ce1ca8 Mon Sep 17 00:00:00 2001 From: Jon Sagara Date: Wed, 15 Nov 2023 21:37:34 -0800 Subject: [PATCH] Renamed STJsonHelper to SystemTextJsonHelper. --- Directory.Build.props | 2 +- .../ModelState/ModelStateDictionaryExtensions.cs | 2 +- src/Sagara.Core.Caching/RedisCache.cs | 10 +++++----- .../{STJsonHelper.cs => SystemTextJsonHelper.cs} | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/Sagara.Core/Json/SystemTextJson/{STJsonHelper.cs => SystemTextJsonHelper.cs} (98%) diff --git a/Directory.Build.props b/Directory.Build.props index 2f1e07b..b86d1af 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ 12.0 - 2.0.3 + 2.0.4 2.0.0 2.0.0 Jon Sagara diff --git a/src/Sagara.Core.AspNetCore/ModelState/ModelStateDictionaryExtensions.cs b/src/Sagara.Core.AspNetCore/ModelState/ModelStateDictionaryExtensions.cs index adca4eb..dda2708 100644 --- a/src/Sagara.Core.AspNetCore/ModelState/ModelStateDictionaryExtensions.cs +++ b/src/Sagara.Core.AspNetCore/ModelState/ModelStateDictionaryExtensions.cs @@ -86,7 +86,7 @@ private static ContentResult CreateBadRequestJsonContentResult(ModelStateDiction { // Since the vast majority of forms on this site use Pascal casing to match variable names, serialize // model state in Pascal case so that we can work with the client side variable names. - var content = STJsonHelper.Serialize(modelState.ToSlimModelStateDictionary(), camelCase: false); + var content = SystemTextJsonHelper.Serialize(modelState.ToSlimModelStateDictionary(), camelCase: false); return new ContentResult { diff --git a/src/Sagara.Core.Caching/RedisCache.cs b/src/Sagara.Core.Caching/RedisCache.cs index b54b3bd..93c4b57 100644 --- a/src/Sagara.Core.Caching/RedisCache.cs +++ b/src/Sagara.Core.Caching/RedisCache.cs @@ -101,7 +101,7 @@ protected ConnectionMultiplexer InitializeConnectionMultiplexer(ConfigurationOpt if (!string.IsNullOrWhiteSpace(value)) { - return STJsonHelper.Deserialize(value!); + return SystemTextJsonHelper.Deserialize(value!); } } catch (Exception ex) @@ -149,7 +149,7 @@ protected ConnectionMultiplexer InitializeConnectionMultiplexer(ConfigurationOpt var value = (string?)redisResult; if (!string.IsNullOrWhiteSpace(value)) { - return STJsonHelper.Deserialize(value); + return SystemTextJsonHelper.Deserialize(value); } } catch (Exception ex) @@ -183,7 +183,7 @@ protected ConnectionMultiplexer InitializeConnectionMultiplexer(ConfigurationOpt var value = (string?)redisResult; if (!string.IsNullOrWhiteSpace(value)) { - return STJsonHelper.Deserialize(value); + return SystemTextJsonHelper.Deserialize(value); } } catch (Exception ex) @@ -213,7 +213,7 @@ public async Task SetAsync(string key, object value, TimeSpan? expiry = nu var db = GetDatabase(); return await db - .StringSetAsync(key, STJsonHelper.Serialize(value), expiry) + .StringSetAsync(key, SystemTextJsonHelper.Serialize(value), expiry) .ConfigureAwait(false); } catch (Exception ex) @@ -242,7 +242,7 @@ public bool Set(string key, object value, TimeSpan? expiry = null) { var db = GetDatabase(); - return db.StringSet(key, STJsonHelper.Serialize(value), expiry); + return db.StringSet(key, SystemTextJsonHelper.Serialize(value), expiry); } catch (Exception ex) { diff --git a/src/Sagara.Core/Json/SystemTextJson/STJsonHelper.cs b/src/Sagara.Core/Json/SystemTextJson/SystemTextJsonHelper.cs similarity index 98% rename from src/Sagara.Core/Json/SystemTextJson/STJsonHelper.cs rename to src/Sagara.Core/Json/SystemTextJson/SystemTextJsonHelper.cs index 7ab9c41..67c0215 100644 --- a/src/Sagara.Core/Json/SystemTextJson/STJsonHelper.cs +++ b/src/Sagara.Core/Json/SystemTextJson/SystemTextJsonHelper.cs @@ -5,7 +5,7 @@ namespace Sagara.Core.Json.SystemTextJson; /// /// Helper methods for serializing JSON with System.Text.Json. /// -public static class STJsonHelper +public static class SystemTextJsonHelper { private static JsonSerializerOptions _serializeCamelCasePrettyPrint = new() {