diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/AbpJsonValueConverter.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/AbpJsonValueConverter.cs index 1718ba6419..9e8ed9f3fc 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/AbpJsonValueConverter.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/AbpJsonValueConverter.cs @@ -26,7 +26,7 @@ namespace Volo.Abp.EntityFrameworkCore.ValueConverters new ObjectToInferredTypesConverter() } }; - + private static TPropertyType DeserializeObject(string s) { return JsonSerializer.Deserialize(s, DeserializeOptions); diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs index fd8ab43fd0..9db5624ebf 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs @@ -48,14 +48,14 @@ namespace Volo.Abp.EntityFrameworkCore.ValueConverters new ObjectToInferredTypesConverter() } }; - + private static ExtraPropertyDictionary DeserializeObject(string extraPropertiesAsJson, Type entityType) { if (extraPropertiesAsJson.IsNullOrEmpty() || extraPropertiesAsJson == "{}") { return new ExtraPropertyDictionary(); } - + var dictionary = JsonSerializer.Deserialize(extraPropertiesAsJson, DeserializeOptions) ?? new ExtraPropertyDictionary(); diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs index a70327b8e6..4d9d6ff4ff 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs @@ -94,7 +94,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; - + protected virtual async Task GetApiDescriptionFromServerAsync( HttpClient client, string baseUrl) diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs index 217f40386a..e136de347c 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs @@ -41,7 +41,7 @@ namespace Volo.Abp.Json.SystemTextJson } private readonly ConcurrentDictionary JsonSerializerOptionsCache = new ConcurrentDictionary(); - + protected virtual JsonSerializerOptions CreateJsonSerializerOptions(bool camelCase = true, bool indented = false) { return JsonSerializerOptionsCache.GetOrAdd($"default{camelCase}{indented}", _ => diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToBooleanConverter.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToBooleanConverter.cs index 2cfa03677c..8469f3a3ae 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToBooleanConverter.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToBooleanConverter.cs @@ -7,9 +7,9 @@ using System.Text.Json.Serialization; namespace Volo.Abp.Json.SystemTextJson.JsonConverters { public class AbpStringToBooleanConverter : JsonConverter - { + { private JsonSerializerOptions _writeJsonSerializerOptions; - + public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.String) @@ -33,7 +33,7 @@ namespace Volo.Abp.Json.SystemTextJson.JsonConverters { _writeJsonSerializerOptions ??= JsonSerializerOptionsHelper.Create(options, this); var entityConverter = (JsonConverter)_writeJsonSerializerOptions.GetConverter(typeof(bool)); - + entityConverter.Write(writer, value, _writeJsonSerializerOptions); } } diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs index 8b99b48301..247b7e2b04 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs @@ -11,9 +11,9 @@ namespace Volo.Abp.Json.SystemTextJson.JsonConverters private readonly JsonStringEnumConverter _innerJsonStringEnumConverter; private JsonSerializerOptions _readJsonSerializerOptions; - + private JsonSerializerOptions _writeJsonSerializerOptions; - + public AbpStringToEnumConverter() : this(namingPolicy: null, allowIntegerValues: true) { diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Json/JsonLocalizationDictionaryBuilder.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Json/JsonLocalizationDictionaryBuilder.cs index 79a8cb0ac4..6694c589cb 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Json/JsonLocalizationDictionaryBuilder.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Json/JsonLocalizationDictionaryBuilder.cs @@ -31,7 +31,7 @@ namespace Volo.Abp.Localization.Json ReadCommentHandling = JsonCommentHandling.Skip, AllowTrailingCommas = true }; - + /// /// Builds an from given json string. /// diff --git a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToBoolean_Tests.cs b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToBoolean_Tests.cs index 2653fdb02c..c46a616db0 100644 --- a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToBoolean_Tests.cs +++ b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToBoolean_Tests.cs @@ -21,12 +21,12 @@ namespace Volo.Abp.Json var testClass = JsonSerializer.Deserialize("{\"Enabled\": \"TrUe\"}", options); testClass.ShouldNotBeNull(); testClass.Enabled.ShouldBe(true); - + testClass = JsonSerializer.Deserialize("{\"Enabled\": true}", options); testClass.ShouldNotBeNull(); testClass.Enabled.ShouldBe(true); } - + [Fact] public void Test_Write() { @@ -42,7 +42,7 @@ namespace Volo.Abp.Json { Enabled = true }); - + testClassJson.ShouldBe("{\"Enabled\":true}"); } diff --git a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs index b7aa4de550..d3bba36534 100644 --- a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs +++ b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs @@ -22,12 +22,12 @@ namespace Volo.Abp.Json var testClass = JsonSerializer.Deserialize("{\"Day\": \"Monday\"}", options); testClass.ShouldNotBeNull(); testClass.Day.ShouldBe(DayOfWeek.Monday); - + testClass = JsonSerializer.Deserialize("{\"Day\": 1}", options); testClass.ShouldNotBeNull(); testClass.Day.ShouldBe(DayOfWeek.Monday); } - + [Fact] public void Test_Write() { @@ -43,7 +43,7 @@ namespace Volo.Abp.Json { Day = DayOfWeek.Monday }); - + testClassJson.ShouldBe("{\"Day\":1}"); } diff --git a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/ExtensibleObject_Tests.cs b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/ExtensibleObject_Tests.cs index f3c6095922..9a88705282 100644 --- a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/ExtensibleObject_Tests.cs +++ b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/ExtensibleObject_Tests.cs @@ -60,7 +60,7 @@ namespace Volo.Abp.Json fooDto.BarDtos.First().Name.ShouldBe("new-bar-dto"); fooDto.BarDtos.First().GetProperty("bar").ShouldBe("new-bar-value"); } - + [Fact] public void SelfReference_Test() { @@ -100,14 +100,14 @@ namespace Volo.Abp.Json class BarDto : ExtensibleObject { public string Name { get; set; } - + public FooDto FooDto { get; set; } } - + class NodeDto : ExtensibleObject { public string Name { get; set; } - + public NodeDto Parent { get; set; } } } diff --git a/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/JsonConverters/EntityJsonConverter.cs b/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/JsonConverters/EntityJsonConverter.cs index 59e550dd92..4d1fb34b73 100644 --- a/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/JsonConverters/EntityJsonConverter.cs +++ b/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/JsonConverters/EntityJsonConverter.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.MemoryDb.JsonConverters where TEntity : Entity { private JsonSerializerOptions _writeJsonSerializerOptions; - + public override TEntity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var jsonDocument = JsonDocument.ParseValue(ref reader); diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/SelectionStringValueItemSourceJsonConverter.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/SelectionStringValueItemSourceJsonConverter.cs index 9ec2c47e36..7229ecdd83 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/SelectionStringValueItemSourceJsonConverter.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/SelectionStringValueItemSourceJsonConverter.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.FeatureManagement.JsonConverters public class SelectionStringValueItemSourceJsonConverter : JsonConverter { private JsonSerializerOptions _readJsonSerializerOptions; - + private JsonSerializerOptions _writeJsonSerializerOptions; public override ISelectionStringValueItemSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/StringValueTypeJsonConverter.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/StringValueTypeJsonConverter.cs index 4802f28474..992ba4a183 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/StringValueTypeJsonConverter.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/StringValueTypeJsonConverter.cs @@ -9,9 +9,9 @@ namespace Volo.Abp.FeatureManagement.JsonConverters public class StringValueTypeJsonConverter : JsonConverter { private JsonSerializerOptions _readJsonSerializerOptions; - + private JsonSerializerOptions _writeJsonSerializerOptions; - + public override IStringValueType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var rootElement = JsonDocument.ParseValue(ref reader).RootElement; diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/ValueValidatorJsonConverter.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/ValueValidatorJsonConverter.cs index d42265f2c5..5cd51d09c4 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/ValueValidatorJsonConverter.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/ValueValidatorJsonConverter.cs @@ -11,9 +11,9 @@ namespace Volo.Abp.FeatureManagement.JsonConverters public class ValueValidatorJsonConverter : JsonConverter { private JsonSerializerOptions _readJsonSerializerOptions; - + private JsonSerializerOptions _writeJsonSerializerOptions; - + public override IValueValidator Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var rootElement = JsonDocument.ParseValue(ref reader).RootElement;