Browse Source

Remove empty lines.

pull/10775/head
maliming 5 years ago
parent
commit
9f595cec96
No known key found for this signature in database GPG Key ID: 96224957E51C89E
  1. 2
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/AbpJsonValueConverter.cs
  2. 4
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs
  3. 2
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs
  4. 2
      framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs
  5. 6
      framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToBooleanConverter.cs
  6. 4
      framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
  7. 2
      framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Json/JsonLocalizationDictionaryBuilder.cs
  8. 6
      framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToBoolean_Tests.cs
  9. 6
      framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs
  10. 8
      framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/ExtensibleObject_Tests.cs
  11. 2
      framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/JsonConverters/EntityJsonConverter.cs
  12. 2
      modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/SelectionStringValueItemSourceJsonConverter.cs
  13. 4
      modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/StringValueTypeJsonConverter.cs
  14. 4
      modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/JsonConverters/ValueValidatorJsonConverter.cs

2
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<TPropertyType>(s, DeserializeOptions);

4
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<ExtraPropertyDictionary>(extraPropertiesAsJson, DeserializeOptions) ??
new ExtraPropertyDictionary();

2
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<ApplicationApiDescriptionModel> GetApiDescriptionFromServerAsync(
HttpClient client,
string baseUrl)

2
framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerProvider.cs

@ -41,7 +41,7 @@ namespace Volo.Abp.Json.SystemTextJson
}
private readonly ConcurrentDictionary<string, JsonSerializerOptions> JsonSerializerOptionsCache = new ConcurrentDictionary<string, JsonSerializerOptions>();
protected virtual JsonSerializerOptions CreateJsonSerializerOptions(bool camelCase = true, bool indented = false)
{
return JsonSerializerOptionsCache.GetOrAdd($"default{camelCase}{indented}", _ =>

6
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<bool>
{
{
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<bool>)_writeJsonSerializerOptions.GetConverter(typeof(bool));
entityConverter.Write(writer, value, _writeJsonSerializerOptions);
}
}

4
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)
{

2
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
};
/// <summary>
/// Builds an <see cref="JsonLocalizationDictionaryBuilder" /> from given json string.
/// </summary>

6
framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToBoolean_Tests.cs

@ -21,12 +21,12 @@ namespace Volo.Abp.Json
var testClass = JsonSerializer.Deserialize<TestClass>("{\"Enabled\": \"TrUe\"}", options);
testClass.ShouldNotBeNull();
testClass.Enabled.ShouldBe(true);
testClass = JsonSerializer.Deserialize<TestClass>("{\"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}");
}

6
framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs

@ -22,12 +22,12 @@ namespace Volo.Abp.Json
var testClass = JsonSerializer.Deserialize<TestClass>("{\"Day\": \"Monday\"}", options);
testClass.ShouldNotBeNull();
testClass.Day.ShouldBe(DayOfWeek.Monday);
testClass = JsonSerializer.Deserialize<TestClass>("{\"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}");
}

8
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; }
}
}

2
framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/JsonConverters/EntityJsonConverter.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.MemoryDb.JsonConverters
where TEntity : Entity<TKey>
{
private JsonSerializerOptions _writeJsonSerializerOptions;
public override TEntity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var jsonDocument = JsonDocument.ParseValue(ref reader);

2
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<ISelectionStringValueItemSource>
{
private JsonSerializerOptions _readJsonSerializerOptions;
private JsonSerializerOptions _writeJsonSerializerOptions;
public override ISelectionStringValueItemSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

4
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<IStringValueType>
{
private JsonSerializerOptions _readJsonSerializerOptions;
private JsonSerializerOptions _writeJsonSerializerOptions;
public override IStringValueType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var rootElement = JsonDocument.ParseValue(ref reader).RootElement;

4
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<IValueValidator>
{
private JsonSerializerOptions _readJsonSerializerOptions;
private JsonSerializerOptions _writeJsonSerializerOptions;
public override IValueValidator Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var rootElement = JsonDocument.ParseValue(ref reader).RootElement;

Loading…
Cancel
Save