Skip to content

Commit 0eb038a

Browse files
committed
Complete .net8 upgrade
1 parent 1e64fbf commit 0eb038a

36 files changed

+816
-3025
lines changed

Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup Label="Build">
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net8.0;net6.0;net462;net472;net48</TargetFrameworks>
5+
<TargetFrameworks>net8.0;net48</TargetFrameworks>
66
<IsPackable>false</IsPackable>
77
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
88
</PropertyGroup>
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313

1414
<ItemGroup Label="Package References">
15-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
15+
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
1616
</ItemGroup>
1717

1818
</Project>

Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ namespace Schema.NET.Benchmarks;
1313
[CsvMeasurementsExporter]
1414
[RPlotExporter]
1515
[SimpleJob(RuntimeMoniker.Net80)]
16-
[SimpleJob(RuntimeMoniker.Net60)]
17-
[SimpleJob(RuntimeMoniker.Net462)]
18-
[SimpleJob(RuntimeMoniker.Net472)]
1916
[SimpleJob(RuntimeMoniker.Net48)]
2017
public abstract class SchemaBenchmarkBase
2118
{

Benchmarks/Schema.NET.Benchmarks/packages.lock.json

Lines changed: 306 additions & 1356 deletions
Large diffs are not rendered by default.

Source/Common/ContextJsonConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ContextJsonConverter : JsonConverter<JsonLdContext>
1313
/// <inheritdoc />
1414
public override JsonLdContext Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
1515
{
16-
#if NET6_0_OR_GREATER
16+
#if NET
1717
ArgumentNullException.ThrowIfNull(typeToConvert);
1818
ArgumentNullException.ThrowIfNull(options);
1919
#else
@@ -82,7 +82,7 @@ public override JsonLdContext Read(ref Utf8JsonReader reader, Type typeToConvert
8282
/// <inheritdoc />
8383
public override void Write(Utf8JsonWriter writer, JsonLdContext value, JsonSerializerOptions options)
8484
{
85-
#if NET6_0_OR_GREATER
85+
#if NET
8686
ArgumentNullException.ThrowIfNull(writer);
8787
ArgumentNullException.ThrowIfNull(value);
8888
ArgumentNullException.ThrowIfNull(options);

Source/Common/DateTimeToIso8601DateValuesJsonConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class DateTimeToIso8601DateValuesJsonConverter : ValuesJsonConverter
2323
/// <param name="options">The JSON serializer options.</param>
2424
public override void WriteObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
2525
{
26-
#if NET6_0_OR_GREATER
26+
#if NET
2727
ArgumentNullException.ThrowIfNull(writer);
2828
ArgumentNullException.ThrowIfNull(options);
2929
#else

Source/Common/EnumHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static bool TryParse(
2323
[NotNullWhen(true)]
2424
#endif
2525
string? value,
26-
#if NET6_0_OR_GREATER
26+
#if NET
2727
out object? result) =>
2828
Enum.TryParse(enumType, value, out result);
2929
#else
@@ -59,7 +59,7 @@ public static bool TryParseEnumFromSchemaUri(
5959
string? value,
6060
out object? result)
6161
{
62-
#if NET6_0_OR_GREATER
62+
#if NET
6363
ArgumentNullException.ThrowIfNull(enumType);
6464
#else
6565
if (enumType is null)

Source/Common/OneOrMany{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public OneOrMany(T? item)
3030
}
3131
else
3232
{
33-
this.collection = new[] { item };
33+
this.collection = [item];
3434
this.HasOne = true;
3535
}
3636
}

Source/Common/SchemaEnumJsonConverter{T}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public SchemaEnumJsonConverter()
4141
/// <returns>The enumeration value.</returns>
4242
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
4343
{
44-
#if NET6_0_OR_GREATER
44+
#if NET
4545
ArgumentNullException.ThrowIfNull(typeToConvert);
4646
#else
4747
if (typeToConvert is null)
@@ -67,7 +67,7 @@ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerial
6767
/// <param name="options">The JSON serializer options.</param>
6868
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
6969
{
70-
#if NET6_0_OR_GREATER
70+
#if NET
7171
ArgumentNullException.ThrowIfNull(writer);
7272
ArgumentNullException.ThrowIfNull(options);
7373
#else

Source/Common/TimeSpanToISO8601DurationValuesJsonConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class TimeSpanToISO8601DurationValuesJsonConverter : ValuesJsonConverter
2121
/// <param name="options">The JSON serializer options.</param>
2222
public override void WriteObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
2323
{
24-
#if NET6_0_OR_GREATER
24+
#if NET
2525
ArgumentNullException.ThrowIfNull(writer);
2626
ArgumentNullException.ThrowIfNull(options);
2727
#else

Source/Common/ValuesJsonConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static ValuesJsonConverter()
4242
/// <returns>The object value.</returns>
4343
public override IValues? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
4444
{
45-
#if NET6_0_OR_GREATER
45+
#if NET
4646
ArgumentNullException.ThrowIfNull(typeToConvert);
4747
ArgumentNullException.ThrowIfNull(options);
4848
#else
@@ -100,7 +100,7 @@ static ValuesJsonConverter()
100100
/// <param name="options">The JSON serializer options.</param>
101101
public override void Write(Utf8JsonWriter writer, IValues value, JsonSerializerOptions options)
102102
{
103-
#if NET6_0_OR_GREATER
103+
#if NET
104104
ArgumentNullException.ThrowIfNull(writer);
105105
ArgumentNullException.ThrowIfNull(value);
106106
ArgumentNullException.ThrowIfNull(options);
@@ -146,7 +146,7 @@ public override void Write(Utf8JsonWriter writer, IValues value, JsonSerializerO
146146
/// <param name="options">The JSON serializer options.</param>
147147
public virtual void WriteObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
148148
{
149-
#if NET6_0_OR_GREATER
149+
#if NET
150150
ArgumentNullException.ThrowIfNull(writer);
151151
ArgumentNullException.ThrowIfNull(options);
152152
#else

0 commit comments

Comments
 (0)