diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpHasExtraPropertiesJsonConverter.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpHasExtraPropertiesJsonConverter.cs index ebd561c0ae..792b96144e 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpHasExtraPropertiesJsonConverter.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpHasExtraPropertiesJsonConverter.cs @@ -27,12 +27,13 @@ namespace Volo.Abp.Json.SystemTextJson.JsonConverters var rootElement = JsonDocument.ParseValue(ref reader).RootElement; if (rootElement.ValueKind == JsonValueKind.Object) { - var extensibleObject = JsonSerializer.Deserialize(rootElement.GetRawText(), newOptions); + var extensibleObject = rootElement.Deserialize(newOptions); var extraPropertiesJsonProperty = rootElement.EnumerateObject().FirstOrDefault(x => x.Name.Equals(nameof(IHasExtraProperties.ExtraProperties), StringComparison.OrdinalIgnoreCase)); + if (extraPropertiesJsonProperty.Value.ValueKind == JsonValueKind.Object) { - var extraPropertyDictionary = JsonSerializer.Deserialize(extraPropertiesJsonProperty.Value.GetRawText(), typeof(ExtraPropertyDictionary), newOptions); + var extraPropertyDictionary = extraPropertiesJsonProperty.Value.Deserialize(typeof(ExtraPropertyDictionary), newOptions); ObjectHelper.TrySetProperty(extensibleObject, x => x.ExtraProperties, () => extraPropertyDictionary); } 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 09c08af9a8..2a26c6ee42 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 @@ -13,12 +13,12 @@ namespace Volo.Abp.MemoryDb.JsonConverters var jsonDocument = JsonDocument.ParseValue(ref reader); if (jsonDocument.RootElement.ValueKind == JsonValueKind.Object) { - var entity = (TEntity)JsonSerializer.Deserialize(jsonDocument.RootElement.GetRawText(), typeToConvert); + var entity = (TEntity)jsonDocument.RootElement.Deserialize(typeToConvert); var idJsonElement = jsonDocument.RootElement.GetProperty(nameof(Entity.Id)); if (idJsonElement.ValueKind != JsonValueKind.Undefined) { - var id = JsonSerializer.Deserialize(idJsonElement.GetRawText()); + var id = idJsonElement.Deserialize(); if (id != null) { EntityHelper.TrySetId(entity, () => id); 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 bae37dbff9..9d62f9952c 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 @@ -19,7 +19,7 @@ namespace Volo.Abp.FeatureManagement.JsonConverters var newOptions = JsonSerializerOptionsHelper.Create(options, this); var selectionStringValueItem = - JsonSerializer.Deserialize(itemsJsonProperty.Value.GetRawText(), newOptions) ?? + itemsJsonProperty.Value.Deserialize(newOptions) ?? Array.Empty(); return new StaticSelectionStringValueItemSource(selectionStringValueItem.As()); 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 0d2196e911..408ef2f99b 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 @@ -22,9 +22,9 @@ namespace Volo.Abp.FeatureManagement.JsonConverters return name switch { - "SelectionStringValueType" => JsonSerializer.Deserialize(rootElement.GetRawText(), newOptions), - "FreeTextStringValueType" => JsonSerializer.Deserialize(rootElement.GetRawText(), newOptions), - "ToggleStringValueType" => JsonSerializer.Deserialize(rootElement.GetRawText(), newOptions), + "SelectionStringValueType" => rootElement.Deserialize(newOptions), + "FreeTextStringValueType" => rootElement.Deserialize(newOptions), + "ToggleStringValueType" => rootElement.Deserialize(newOptions), _ => throw new ArgumentException($"{nameof(IStringValueType)} named {name} was not found!") }; } 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 25bb603c1a..27f92cc0ec 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 @@ -23,7 +23,7 @@ namespace Volo.Abp.FeatureManagement.JsonConverters if (propertiesJsonProperty.Value.ValueKind == JsonValueKind.Object) { var newOptions = JsonSerializerOptionsHelper.Create(options, this, new ObjectToInferredTypesConverter()); - var properties = JsonSerializer.Deserialize>(propertiesJsonProperty.Value.GetRawText(), newOptions); + var properties = propertiesJsonProperty.Value.Deserialize>(newOptions); if (properties != null && properties.Any()) { foreach (var property in properties)