diff --git a/.editorconfig b/.editorconfig
index e63069d8..8e2da5d3 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -523,3 +523,5 @@ dotnet_naming_rule.parameters_rule.severity = warning
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
##########################################
+
+dotnet_style_require_accessibility_modifiers = for_non_interface_members
\ No newline at end of file
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5d91e28e..92c4a397 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -33,10 +33,12 @@ jobs:
with:
lfs: true
fetch-depth: 0
- - name: "Install .NET 8.0 SDK"
+ - name: "Setup dotnet"
uses: actions/setup-dotnet@v5.0.0
with:
- dotnet-version: 8.0.x
+ dotnet-version: |
+ 8.0.x
+ 10.0.x
- name: "Dotnet Tool Restore"
run: dotnet tool restore
shell: pwsh
@@ -84,6 +86,7 @@ jobs:
url: https://github.com/TimmyMC/Schema.NET/packages
permissions:
packages: write
+ id-token: write
runs-on: windows-latest
steps:
- name: "Download Artefact"
@@ -110,9 +113,14 @@ jobs:
uses: actions/download-artifact@v6.0.0
with:
name: "windows-latest"
+ - name: NuGet login (OIDC → temp API key)
+ uses: NuGet/login@v1
+ id: login
+ with:
+ user: "TimmyMC"
- name: "Dotnet NuGet Push"
run: |
Get-ChildItem .\ -Filter *.nupkg |
Where-Object { !$_.Name.Contains('preview') } |
- ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} }
+ ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} }
shell: pwsh
diff --git a/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj b/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj
index deff4ff7..852f3394 100644
--- a/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj
+++ b/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj
@@ -2,9 +2,8 @@
Exe
- net8.0;net48
+ net10.0;net8.0
false
- true
diff --git a/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs b/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs
index 78887f0c..cd2ccc7a 100644
--- a/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs
+++ b/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs
@@ -13,7 +13,7 @@ namespace Schema.NET.Benchmarks;
[CsvMeasurementsExporter]
[RPlotExporter]
[SimpleJob(RuntimeMoniker.Net80)]
-[SimpleJob(RuntimeMoniker.Net48)]
+[SimpleJob(RuntimeMoniker.Net10_0)]
public abstract class SchemaBenchmarkBase
{
public Thing Thing { get; set; } = default!;
diff --git a/Benchmarks/Schema.NET.Benchmarks/packages.lock.json b/Benchmarks/Schema.NET.Benchmarks/packages.lock.json
index 5ca9753d..3d71a0ae 100644
--- a/Benchmarks/Schema.NET.Benchmarks/packages.lock.json
+++ b/Benchmarks/Schema.NET.Benchmarks/packages.lock.json
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
- ".NETFramework,Version=v4.8": {
+ "net10.0": {
"BenchmarkDotNet": {
"type": "Direct",
"requested": "[0.15.6, )",
@@ -16,32 +16,15 @@
"Microsoft.Diagnostics.Runtime": "3.1.512801",
"Microsoft.Diagnostics.Tracing.TraceEvent": "3.1.21",
"Microsoft.DotNet.PlatformAbstractions": "3.1.6",
- "Microsoft.Win32.Registry": "5.0.0",
"Perfolizer": "[0.6.0]",
- "System.Management": "9.0.5",
- "System.Numerics.Vectors": "4.5.0",
- "System.Reflection.Emit": "4.7.0",
- "System.Reflection.Emit.Lightweight": "4.7.0",
- "System.Threading.Tasks.Extensions": "4.6.3"
+ "System.Management": "9.0.5"
}
},
- "Microsoft.CodeAnalysis.NetAnalyzers": {
- "type": "Direct",
- "requested": "[8.0.0, )",
- "resolved": "8.0.0",
- "contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg=="
- },
- "Microsoft.VisualStudio.Threading.Analyzers": {
- "type": "Direct",
- "requested": "[17.12.19, )",
- "resolved": "17.12.19",
- "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ=="
- },
"MinVer": {
"type": "Direct",
- "requested": "[4.3.0, )",
- "resolved": "4.3.0",
- "contentHash": "YNVAW3loCFW4kTwensApaZUl+7xREK75QQNOFSbsbXx2sCSm9/IHBjUHsJGn3u0UA5r/sAqrdYBNUlOFfLhUrA=="
+ "requested": "[6.0.0, )",
+ "resolved": "6.0.0",
+ "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g=="
},
"BenchmarkDotNet.Annotations": {
"type": "Transitive",
@@ -53,6 +36,11 @@
"resolved": "2.9.1",
"contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA=="
},
+ "DotNet.ReproducibleBuilds": {
+ "type": "Transitive",
+ "resolved": "1.2.39",
+ "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg=="
+ },
"Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.3.0",
@@ -63,14 +51,6 @@
"resolved": "1.21.0",
"contentHash": "dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg=="
},
- "Microsoft.Bcl.AsyncInterfaces": {
- "type": "Transitive",
- "resolved": "10.0.0",
- "contentHash": "vFuwSLj9QJBbNR0NeNO4YVASUbokxs+i/xbuu8B+Fs4FAZg5QaFa6eGrMaRqTzzNI5tAb97T7BhSxtLckFyiRA==",
- "dependencies": {
- "System.Threading.Tasks.Extensions": "4.6.3"
- }
- },
"Microsoft.CodeAnalysis.Analyzers": {
"type": "Transitive",
"resolved": "3.11.0",
@@ -82,14 +62,8 @@
"contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==",
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "3.11.0",
- "System.Buffers": "4.5.1",
"System.Collections.Immutable": "9.0.0",
- "System.Memory": "4.5.5",
- "System.Numerics.Vectors": "4.5.0",
- "System.Reflection.Metadata": "9.0.0",
- "System.Runtime.CompilerServices.Unsafe": "6.0.0",
- "System.Text.Encoding.CodePages": "7.0.0",
- "System.Threading.Tasks.Extensions": "4.5.4"
+ "System.Reflection.Metadata": "9.0.0"
}
},
"Microsoft.CodeAnalysis.CSharp": {
@@ -99,14 +73,8 @@
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "3.11.0",
"Microsoft.CodeAnalysis.Common": "[4.14.0]",
- "System.Buffers": "4.5.1",
"System.Collections.Immutable": "9.0.0",
- "System.Memory": "4.5.5",
- "System.Numerics.Vectors": "4.5.0",
- "System.Reflection.Metadata": "9.0.0",
- "System.Runtime.CompilerServices.Unsafe": "6.0.0",
- "System.Text.Encoding.CodePages": "7.0.0",
- "System.Threading.Tasks.Extensions": "4.5.4"
+ "System.Reflection.Metadata": "9.0.0"
}
},
"Microsoft.Diagnostics.NETCore.Client": {
@@ -114,9 +82,7 @@
"resolved": "0.2.510501",
"contentHash": "juoqJYMDs+lRrrZyOkXXMImJHneCF23cuvO4waFRd2Ds7j+ZuGIPbJm0Y/zz34BdeaGiiwGWraMUlln05W1PCQ==",
"dependencies": {
- "Microsoft.Bcl.AsyncInterfaces": "6.0.0",
- "Microsoft.Extensions.Logging": "6.0.0",
- "System.Buffers": "4.5.1"
+ "Microsoft.Extensions.Logging": "6.0.0"
}
},
"Microsoft.Diagnostics.Runtime": {
@@ -124,9 +90,7 @@
"resolved": "3.1.512801",
"contentHash": "0lMUDr2oxNZa28D6NH5BuSQEe5T9tZziIkvkD44YkkCGQXPJqvFjLq5ZQq1hYLl3RjQJrY+hR0jFgap+EWPDTw==",
"dependencies": {
- "Microsoft.Diagnostics.NETCore.Client": "0.2.410101",
- "System.Collections.Immutable": "6.0.0",
- "System.Runtime.CompilerServices.Unsafe": "6.0.0"
+ "Microsoft.Diagnostics.NETCore.Client": "0.2.410101"
}
},
"Microsoft.Diagnostics.Tracing.TraceEvent": {
@@ -146,53 +110,38 @@
"Microsoft.DotNet.PlatformAbstractions": {
"type": "Transitive",
"resolved": "3.1.6",
- "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==",
- "dependencies": {
- "System.Runtime.InteropServices.RuntimeInformation": "4.0.0"
- }
+ "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg=="
},
"Microsoft.Extensions.DependencyInjection": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==",
"dependencies": {
- "Microsoft.Bcl.AsyncInterfaces": "6.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
- "System.Runtime.CompilerServices.Unsafe": "6.0.0",
- "System.Threading.Tasks.Extensions": "4.5.4"
+ "System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
- "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==",
- "dependencies": {
- "Microsoft.Bcl.AsyncInterfaces": "6.0.0",
- "System.Threading.Tasks.Extensions": "4.5.4"
- }
+ "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg=="
},
"Microsoft.Extensions.Logging": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==",
"dependencies": {
- "Microsoft.Bcl.AsyncInterfaces": "6.0.0",
"Microsoft.Extensions.DependencyInjection": "6.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
"Microsoft.Extensions.Options": "6.0.0",
- "System.Diagnostics.DiagnosticSource": "6.0.0",
- "System.ValueTuple": "4.5.0"
+ "System.Diagnostics.DiagnosticSource": "6.0.0"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
- "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==",
- "dependencies": {
- "System.Buffers": "4.5.1",
- "System.Memory": "4.5.4"
- }
+ "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA=="
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
@@ -208,10 +157,19 @@
"resolved": "6.0.0",
"contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==",
"dependencies": {
- "System.Memory": "4.5.4",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
+ "Microsoft.NETCore.Platforms": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ=="
+ },
+ "Microsoft.VisualStudio.Threading.Analyzers": {
+ "type": "Transitive",
+ "resolved": "17.14.15",
+ "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw=="
+ },
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "5.0.0",
@@ -226,22 +184,13 @@
"resolved": "0.6.0",
"contentHash": "mIhFTO23WVG66d2sqr0B0YlIOuTbyZjpaDMFoWPD1FQUwLOrWeMEpZEf8BqN24IDzfplgaSjl67wy+yUmtYaZA==",
"dependencies": {
- "Pragmastat": "3.1.33",
- "System.Memory": "4.5.5"
+ "Pragmastat": "3.1.33"
}
},
"Pragmastat": {
"type": "Transitive",
"resolved": "3.1.33",
- "contentHash": "qADZRnkNg1Emeu2xCnJAOl3ISrH5zfm/TMbk4qPgcvT9sydB+ceK27tdJM89Lycc0MleB/JMWpE9gPUooq7wgA==",
- "dependencies": {
- "System.Memory": "4.5.5"
- }
- },
- "System.Buffers": {
- "type": "Transitive",
- "resolved": "4.6.1",
- "contentHash": "N8GXpmiLMtljq7gwvyS+1QvKT/W2J8sNAvx+HVg4NGmsG/H+2k/y9QI23auLJRterrzCiDH+IWAw4V/GPwsMlw=="
+ "contentHash": "qADZRnkNg1Emeu2xCnJAOl3ISrH5zfm/TMbk4qPgcvT9sydB+ceK27tdJM89Lycc0MleB/JMWpE9gPUooq7wgA=="
},
"System.CodeDom": {
"type": "Transitive",
@@ -251,31 +200,16 @@
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "9.0.0",
- "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==",
- "dependencies": {
- "System.Memory": "4.5.5",
- "System.Runtime.CompilerServices.Unsafe": "6.0.0"
- }
+ "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w=="
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==",
"dependencies": {
- "System.Memory": "4.5.4",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
- "System.IO.Pipelines": {
- "type": "Transitive",
- "resolved": "10.0.0",
- "contentHash": "M1eb3nfXntaRJPrrMVM9EFS8I1bDTnt0uvUS6QP/SicZf/ZZjydMD5NiXxfmwW/uQwaMDP/yX2P+zQN1NBHChg==",
- "dependencies": {
- "System.Buffers": "4.6.1",
- "System.Memory": "4.6.3",
- "System.Threading.Tasks.Extensions": "4.6.3"
- }
- },
"System.Management": {
"type": "Transitive",
"resolved": "9.0.5",
@@ -284,39 +218,10 @@
"System.CodeDom": "9.0.5"
}
},
- "System.Memory": {
- "type": "Transitive",
- "resolved": "4.6.3",
- "contentHash": "qdcDOgnFZY40+Q9876JUHnlHu7bosOHX8XISRoH94fwk6hgaeQGSgfZd8srWRZNt5bV9ZW2TljcegDNxsf+96A==",
- "dependencies": {
- "System.Buffers": "4.6.1",
- "System.Numerics.Vectors": "4.6.1",
- "System.Runtime.CompilerServices.Unsafe": "6.1.2"
- }
- },
- "System.Numerics.Vectors": {
- "type": "Transitive",
- "resolved": "4.6.1",
- "contentHash": "sQxefTnhagrhoq2ReR0D/6K0zJcr9Hrd6kikeXsA1I8kOCboTavcUC4r7TSfpKFeE163uMuxZcyfO1mGO3EN8Q=="
- },
- "System.Reflection.Emit": {
- "type": "Transitive",
- "resolved": "4.7.0",
- "contentHash": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ=="
- },
- "System.Reflection.Emit.Lightweight": {
- "type": "Transitive",
- "resolved": "4.7.0",
- "contentHash": "a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA=="
- },
"System.Reflection.Metadata": {
"type": "Transitive",
"resolved": "9.0.0",
- "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==",
- "dependencies": {
- "System.Collections.Immutable": "9.0.0",
- "System.Memory": "4.5.5"
- }
+ "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ=="
},
"System.Reflection.TypeExtensions": {
"type": "Transitive",
@@ -325,19 +230,15 @@
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
- "resolved": "6.1.2",
- "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw=="
- },
- "System.Runtime.InteropServices.RuntimeInformation": {
- "type": "Transitive",
- "resolved": "4.0.0",
- "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng=="
+ "resolved": "6.0.0",
+ "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"System.Security.AccessControl": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
"dependencies": {
+ "Microsoft.NETCore.Platforms": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
}
},
@@ -346,93 +247,30 @@
"resolved": "5.0.0",
"contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
},
- "System.Text.Encoding.CodePages": {
- "type": "Transitive",
- "resolved": "7.0.0",
- "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==",
- "dependencies": {
- "System.Memory": "4.5.5",
- "System.Runtime.CompilerServices.Unsafe": "6.0.0"
- }
- },
- "System.Text.Encodings.Web": {
- "type": "Transitive",
- "resolved": "10.0.0",
- "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==",
- "dependencies": {
- "System.Buffers": "4.6.1",
- "System.Memory": "4.6.3",
- "System.Runtime.CompilerServices.Unsafe": "6.1.2"
- }
- },
"System.Text.Json": {
"type": "Transitive",
"resolved": "10.0.0",
- "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==",
- "dependencies": {
- "Microsoft.Bcl.AsyncInterfaces": "10.0.0",
- "System.Buffers": "4.6.1",
- "System.IO.Pipelines": "10.0.0",
- "System.Memory": "4.6.3",
- "System.Runtime.CompilerServices.Unsafe": "6.1.2",
- "System.Text.Encodings.Web": "10.0.0",
- "System.Threading.Tasks.Extensions": "4.6.3",
- "System.ValueTuple": "4.6.1"
- }
- },
- "System.Threading.Tasks.Extensions": {
- "type": "Transitive",
- "resolved": "4.6.3",
- "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==",
- "dependencies": {
- "System.Runtime.CompilerServices.Unsafe": "6.1.2"
- }
- },
- "System.ValueTuple": {
- "type": "Transitive",
- "resolved": "4.6.1",
- "contentHash": "+RJT4qaekpZ7DDLhf+LTjq+E48jieKiY9ulJ+BoxKmZblIJfIJT8Ufcaa/clQqnYvWs8jugfGSMu8ylS0caG0w=="
+ "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw=="
},
"schema.net": {
"type": "Project",
"dependencies": {
+ "DotNet.ReproducibleBuilds": "[1.2.39, )",
"Microsoft.CodeAnalysis.CSharp": "[4.14.0, )",
+ "Microsoft.VisualStudio.Threading.Analyzers": "[17.14.15, )",
+ "MinVer": "[6.0.0, )",
+ "Schema.NET.Common": "[1.0.0, )",
"System.Text.Json": "[10.0.0, )"
}
- }
- },
- ".NETFramework,Version=v4.8/win7-x86": {
- "Gee.External.Capstone": {
- "type": "Transitive",
- "resolved": "2.3.0",
- "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw=="
- },
- "Microsoft.Win32.Registry": {
- "type": "Transitive",
- "resolved": "5.0.0",
- "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
- "dependencies": {
- "System.Security.AccessControl": "5.0.0",
- "System.Security.Principal.Windows": "5.0.0"
- }
},
- "System.Runtime.InteropServices.RuntimeInformation": {
- "type": "Transitive",
- "resolved": "4.0.0",
- "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng=="
- },
- "System.Security.AccessControl": {
- "type": "Transitive",
- "resolved": "5.0.0",
- "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
+ "schema.net.common": {
+ "type": "Project",
"dependencies": {
- "System.Security.Principal.Windows": "5.0.0"
+ "DotNet.ReproducibleBuilds": "[1.2.39, )",
+ "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )",
+ "MinVer": "[6.0.0, )",
+ "System.Text.Json": "[10.0.0, )"
}
- },
- "System.Security.Principal.Windows": {
- "type": "Transitive",
- "resolved": "5.0.0",
- "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
}
},
"net8.0": {
@@ -454,23 +292,11 @@
"System.Management": "9.0.5"
}
},
- "Microsoft.CodeAnalysis.NetAnalyzers": {
- "type": "Direct",
- "requested": "[8.0.0, )",
- "resolved": "8.0.0",
- "contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg=="
- },
- "Microsoft.VisualStudio.Threading.Analyzers": {
- "type": "Direct",
- "requested": "[17.12.19, )",
- "resolved": "17.12.19",
- "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ=="
- },
"MinVer": {
"type": "Direct",
- "requested": "[4.3.0, )",
- "resolved": "4.3.0",
- "contentHash": "YNVAW3loCFW4kTwensApaZUl+7xREK75QQNOFSbsbXx2sCSm9/IHBjUHsJGn3u0UA5r/sAqrdYBNUlOFfLhUrA=="
+ "requested": "[6.0.0, )",
+ "resolved": "6.0.0",
+ "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g=="
},
"BenchmarkDotNet.Annotations": {
"type": "Transitive",
@@ -482,6 +308,11 @@
"resolved": "2.9.1",
"contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA=="
},
+ "DotNet.ReproducibleBuilds": {
+ "type": "Transitive",
+ "resolved": "1.2.39",
+ "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg=="
+ },
"Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.3.0",
@@ -606,6 +437,11 @@
"resolved": "5.0.0",
"contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ=="
},
+ "Microsoft.VisualStudio.Threading.Analyzers": {
+ "type": "Transitive",
+ "resolved": "17.14.15",
+ "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw=="
+ },
"Microsoft.Win32.Registry": {
"type": "Transitive",
"resolved": "5.0.0",
@@ -708,52 +544,22 @@
"schema.net": {
"type": "Project",
"dependencies": {
+ "DotNet.ReproducibleBuilds": "[1.2.39, )",
"Microsoft.CodeAnalysis.CSharp": "[4.14.0, )",
+ "Microsoft.VisualStudio.Threading.Analyzers": "[17.14.15, )",
+ "MinVer": "[6.0.0, )",
+ "Schema.NET.Common": "[1.0.0, )",
"System.Text.Json": "[10.0.0, )"
}
- }
- },
- "net8.0/win7-x86": {
- "Gee.External.Capstone": {
- "type": "Transitive",
- "resolved": "2.3.0",
- "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw=="
},
- "Microsoft.Win32.Registry": {
- "type": "Transitive",
- "resolved": "5.0.0",
- "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
- "dependencies": {
- "System.Security.AccessControl": "5.0.0",
- "System.Security.Principal.Windows": "5.0.0"
- }
- },
- "System.Management": {
- "type": "Transitive",
- "resolved": "9.0.5",
- "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==",
- "dependencies": {
- "System.CodeDom": "9.0.5"
- }
- },
- "System.Security.AccessControl": {
- "type": "Transitive",
- "resolved": "5.0.0",
- "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
+ "schema.net.common": {
+ "type": "Project",
"dependencies": {
- "Microsoft.NETCore.Platforms": "5.0.0",
- "System.Security.Principal.Windows": "5.0.0"
+ "DotNet.ReproducibleBuilds": "[1.2.39, )",
+ "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )",
+ "MinVer": "[6.0.0, )",
+ "System.Text.Json": "[10.0.0, )"
}
- },
- "System.Security.Principal.Windows": {
- "type": "Transitive",
- "resolved": "5.0.0",
- "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA=="
- },
- "System.Text.Encodings.Web": {
- "type": "Transitive",
- "resolved": "10.0.0",
- "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg=="
}
}
}
diff --git a/Directory.Build.props b/Directory.Build.props
index d3fa5e69..119313df 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -9,7 +9,6 @@
enable
true
true
- true
@@ -26,9 +25,7 @@
-
-
-
+
diff --git a/Key.snk b/Key.snk
deleted file mode 100644
index 2ff0c617..00000000
Binary files a/Key.snk and /dev/null differ
diff --git a/Schema.NET.sln b/Schema.NET.sln
index ed0abc7a..9ad38198 100644
--- a/Schema.NET.sln
+++ b/Schema.NET.sln
@@ -14,14 +14,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
- appveyor.yml = appveyor.yml
- azure-pipelines.yml = azure-pipelines.yml
build.cake = build.cake
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
dotnet-tools.json = dotnet-tools.json
global.json = global.json
- Key.snk = Key.snk
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET", "Source\Schema.NET\Schema.NET.csproj", "{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}"
@@ -83,35 +80,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET.Pending", "Source\Schema.NET.Pending\Schema.NET.Pending.csproj", "{4EDF33FF-4532-4328-A158-D026C66537BA}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{AF228B8A-7290-4E26-8506-934C290C6AE3}"
- ProjectSection(SolutionItems) = preProject
- Source\Common\Constants.cs = Source\Common\Constants.cs
- Source\Common\ContactType.cs = Source\Common\ContactType.cs
- Source\Common\ContextJsonConverter.cs = Source\Common\ContextJsonConverter.cs
- Source\Common\DateTimeHelper.cs = Source\Common\DateTimeHelper.cs
- Source\Common\DateTimeToIso8601DateValuesJsonConverter.cs = Source\Common\DateTimeToIso8601DateValuesJsonConverter.cs
- Source\Common\EnumHelper.cs = Source\Common\EnumHelper.cs
- Source\Common\FastActivator.cs = Source\Common\FastActivator.cs
- Source\Common\HashCode.cs = Source\Common\HashCode.cs
- Source\Common\IValues.cs = Source\Common\IValues.cs
- Source\Common\JsonLdContext.cs = Source\Common\JsonLdContext.cs
- Source\Common\JsonLdObject.cs = Source\Common\JsonLdObject.cs
- Source\Common\OneOrMany{T}.cs = Source\Common\OneOrMany{T}.cs
- Source\Common\PropertyValueSpecification.Partial.cs = Source\Common\PropertyValueSpecification.Partial.cs
- Source\Common\SchemaEnumJsonConverter{T}.cs = Source\Common\SchemaEnumJsonConverter{T}.cs
- Source\Common\SchemaSerializer.cs = Source\Common\SchemaSerializer.cs
- Source\Common\Thing.Partial.cs = Source\Common\Thing.Partial.cs
- Source\Common\TimeSpanToISO8601DurationValuesJsonConverter.cs = Source\Common\TimeSpanToISO8601DurationValuesJsonConverter.cs
- Source\Common\TypeExtensions.cs = Source\Common\TypeExtensions.cs
- Source\Common\ValuesJsonConverter.cs = Source\Common\ValuesJsonConverter.cs
- Source\Common\Values{T1,T2,T3,T4,T5,T6,T7}.cs = Source\Common\Values{T1,T2,T3,T4,T5,T6,T7}.cs
- Source\Common\Values{T1,T2,T3,T4,T5,T6}.cs = Source\Common\Values{T1,T2,T3,T4,T5,T6}.cs
- Source\Common\Values{T1,T2,T3,T4,T5}.cs = Source\Common\Values{T1,T2,T3,T4,T5}.cs
- Source\Common\Values{T1,T2,T3,T4}.cs = Source\Common\Values{T1,T2,T3,T4}.cs
- Source\Common\Values{T1,T2,T3}.cs = Source\Common\Values{T1,T2,T3}.cs
- Source\Common\Values{T1,T2}.cs = Source\Common\Values{T1,T2}.cs
- EndProjectSection
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET.Updater", "Tools\Schema.NET.Updater\Schema.NET.Updater.csproj", "{8923F9E2-4BB8-45F9-9A85-863F381B46EE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{A208CE34-D2DF-4BD2-B6CF-3047883BC820}"
@@ -119,6 +87,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{A208CE34-D
Data\schemaorg-all-https.jsonld = Data\schemaorg-all-https.jsonld
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Schema.NET.Common", "Source\Schema.NET.Common\Schema.NET.Common.csproj", "{E1CB91D3-896B-4E25-882F-5596C4435555}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -149,6 +119,10 @@ Global
{8923F9E2-4BB8-45F9-9A85-863F381B46EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8923F9E2-4BB8-45F9-9A85-863F381B46EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8923F9E2-4BB8-45F9-9A85-863F381B46EE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E1CB91D3-896B-4E25-882F-5596C4435555}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E1CB91D3-896B-4E25-882F-5596C4435555}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E1CB91D3-896B-4E25-882F-5596C4435555}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E1CB91D3-896B-4E25-882F-5596C4435555}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -163,8 +137,8 @@ Global
{040F8F6D-9144-42FD-9B0D-7F88EF0C26C5} = {F20E2797-D1E3-4321-91BB-FAE54954D2A0}
{9444439E-8476-4BAB-AE1E-DBC24B58865F} = {040F8F6D-9144-42FD-9B0D-7F88EF0C26C5}
{4EDF33FF-4532-4328-A158-D026C66537BA} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0}
- {AF228B8A-7290-4E26-8506-934C290C6AE3} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0}
{8923F9E2-4BB8-45F9-9A85-863F381B46EE} = {1D81D082-9C25-4D4E-890E-9CD173532307}
+ {E1CB91D3-896B-4E25-882F-5596C4435555} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {73F36209-F8D6-4066-8951-D97729F773CF}
diff --git a/Schema.NET.sln.DotSettings b/Schema.NET.sln.DotSettings
new file mode 100644
index 00000000..f7fba3f9
--- /dev/null
+++ b/Schema.NET.sln.DotSettings
@@ -0,0 +1,2 @@
+
+ MS
\ No newline at end of file
diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props
index 49fe6e1a..5b3d240f 100644
--- a/Source/Directory.Build.props
+++ b/Source/Directory.Build.props
@@ -10,13 +10,8 @@
-
- true
- ../../Key.snk
-
-
-
+
diff --git a/Source/Common/Constants.cs b/Source/Schema.NET.Common/Constants.cs
similarity index 100%
rename from Source/Common/Constants.cs
rename to Source/Schema.NET.Common/Constants.cs
diff --git a/Source/Common/ContactType.cs b/Source/Schema.NET.Common/ContactType.cs
similarity index 100%
rename from Source/Common/ContactType.cs
rename to Source/Schema.NET.Common/ContactType.cs
diff --git a/Source/Common/ContextJsonConverter.cs b/Source/Schema.NET.Common/ContextJsonConverter.cs
similarity index 83%
rename from Source/Common/ContextJsonConverter.cs
rename to Source/Schema.NET.Common/ContextJsonConverter.cs
index b81d5929..d23ce421 100644
--- a/Source/Common/ContextJsonConverter.cs
+++ b/Source/Schema.NET.Common/ContextJsonConverter.cs
@@ -13,20 +13,9 @@ public class ContextJsonConverter : JsonConverter
///
public override JsonLdContext Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
-#if NET
ArgumentNullException.ThrowIfNull(typeToConvert);
ArgumentNullException.ThrowIfNull(options);
-#else
- if (typeToConvert is null)
- {
- throw new ArgumentNullException(nameof(typeToConvert));
- }
- if (options is null)
- {
- throw new ArgumentNullException(nameof(options));
- }
-#endif
var context = new JsonLdContext();
string? name = null;
@@ -82,26 +71,9 @@ public override JsonLdContext Read(ref Utf8JsonReader reader, Type typeToConvert
///
public override void Write(Utf8JsonWriter writer, JsonLdContext value, JsonSerializerOptions options)
{
-#if NET
ArgumentNullException.ThrowIfNull(writer);
ArgumentNullException.ThrowIfNull(value);
ArgumentNullException.ThrowIfNull(options);
-#else
- if (writer is null)
- {
- throw new ArgumentNullException(nameof(writer));
- }
-
- if (value is null)
- {
- throw new ArgumentNullException(nameof(value));
- }
-
- if (options is null)
- {
- throw new ArgumentNullException(nameof(options));
- }
-#endif
if (string.IsNullOrWhiteSpace(value.Language))
{
diff --git a/Source/Common/DateTimeHelper.cs b/Source/Schema.NET.Common/DateTimeHelper.cs
similarity index 81%
rename from Source/Common/DateTimeHelper.cs
rename to Source/Schema.NET.Common/DateTimeHelper.cs
index 254914d4..c47776f7 100644
--- a/Source/Common/DateTimeHelper.cs
+++ b/Source/Schema.NET.Common/DateTimeHelper.cs
@@ -26,12 +26,12 @@ public static bool ContainsTimeOffset(string? input)
return false;
}
- if (input.IndexOf("+", StringComparison.Ordinal) != -1 || input.IndexOf("Z", StringComparison.Ordinal) != -1)
+ if (input.Contains('+', StringComparison.Ordinal) || input.Contains('Z', StringComparison.Ordinal))
{
return true;
}
- var timeSeparatorIndex = input.IndexOf("T", StringComparison.Ordinal);
+ var timeSeparatorIndex = input.IndexOf('T', StringComparison.Ordinal);
if (timeSeparatorIndex != -1)
{
return input.IndexOf(NegativeOffset, timeSeparatorIndex, StringComparison.Ordinal) != -1;
@@ -46,12 +46,7 @@ public static bool ContainsTimeOffset(string? input)
/// The input string
/// The result date and time
/// True if the input string was able to be parsed into a
- public static bool TryParseMSDateTime(
-#if NETCOREAPP3_1_OR_GREATER
- [NotNullWhen(true)]
-#endif
- string? input,
- out DateTime result)
+ public static bool TryParseMSDateTime([NotNullWhen(true)] string? input, out DateTime result)
{
if (input is not null &&
input.StartsWith(MSDateStringStart, StringComparison.Ordinal) &&
@@ -60,11 +55,7 @@ public static bool TryParseMSDateTime(
var dateTimeStartIndex = MSDateStringStart.Length;
var dateTimeLength = input.IndexOf(MSDateStringEnd, StringComparison.Ordinal) - dateTimeStartIndex;
-#if NETCOREAPP3_1_OR_GREATER
var timeValue = input.AsSpan().Slice(dateTimeStartIndex, dateTimeLength);
-#else
- var timeValue = input.Substring(dateTimeStartIndex, dateTimeLength);
-#endif
if (double.TryParse(timeValue, out var milliseconds))
{
@@ -83,12 +74,7 @@ public static bool TryParseMSDateTime(
/// The input string
/// The result date and time with offset
/// True if the input string was able to be parsed into a
- public static bool TryParseMSDateTimeOffset(
-#if NETCOREAPP3_1_OR_GREATER
- [NotNullWhen(true)]
-#endif
- string? input,
- out DateTimeOffset result)
+ public static bool TryParseMSDateTimeOffset([NotNullWhen(true)] string? input, out DateTimeOffset result)
{
if (input is not null &&
input.StartsWith(MSDateStringStart, StringComparison.Ordinal) &&
@@ -98,16 +84,9 @@ public static bool TryParseMSDateTimeOffset(
var offsetIndex = input.IndexOfAny(OffsetChars);
var dateTimeLength = offsetIndex - dateTimeStartIndex;
var offsetLength = input.IndexOf(MSDateStringEnd, offsetIndex, StringComparison.Ordinal) - offsetIndex;
-
-#if NETCOREAPP3_1_OR_GREATER
var timeValue = input.AsSpan().Slice(dateTimeStartIndex, dateTimeLength);
var offsetType = input.AsSpan().Slice(offsetIndex, 1);
var offsetValue = input.AsSpan().Slice(offsetIndex + 1, offsetLength - 1);
-#else
- var timeValue = input.Substring(dateTimeStartIndex, dateTimeLength);
- var offsetType = input.Substring(offsetIndex, 1);
- var offsetValue = input.Substring(offsetIndex + 1, offsetLength - 1);
-#endif
if (double.TryParse(timeValue, out var milliseconds))
{
diff --git a/Source/Common/DateTimeToIso8601DateValuesJsonConverter.cs b/Source/Schema.NET.Common/DateTimeToIso8601DateValuesJsonConverter.cs
similarity index 84%
rename from Source/Common/DateTimeToIso8601DateValuesJsonConverter.cs
rename to Source/Schema.NET.Common/DateTimeToIso8601DateValuesJsonConverter.cs
index 5dcb4eab..9ba6acb7 100644
--- a/Source/Common/DateTimeToIso8601DateValuesJsonConverter.cs
+++ b/Source/Schema.NET.Common/DateTimeToIso8601DateValuesJsonConverter.cs
@@ -23,20 +23,8 @@ public class DateTimeToIso8601DateValuesJsonConverter : ValuesJsonConverter
/// The JSON serializer options.
public override void WriteObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
{
-#if NET
ArgumentNullException.ThrowIfNull(writer);
ArgumentNullException.ThrowIfNull(options);
-#else
- if (writer is null)
- {
- throw new ArgumentNullException(nameof(writer));
- }
-
- if (options is null)
- {
- throw new ArgumentNullException(nameof(options));
- }
-#endif
if (value is DateTime dateTimeType)
{
diff --git a/Source/Common/EnumHelper.cs b/Source/Schema.NET.Common/EnumHelper.cs
similarity index 71%
rename from Source/Common/EnumHelper.cs
rename to Source/Schema.NET.Common/EnumHelper.cs
index efefb231..0df2eeb8 100644
--- a/Source/Common/EnumHelper.cs
+++ b/Source/Schema.NET.Common/EnumHelper.cs
@@ -19,30 +19,8 @@ public static class EnumHelper
/// if the conversion succeeded; otherwise.
public static bool TryParse(
Type enumType,
-#if NETCOREAPP3_1_OR_GREATER
- [NotNullWhen(true)]
-#endif
- string? value,
-#if NET
- out object? result) =>
- Enum.TryParse(enumType, value, out result);
-#else
- out object? result)
- {
- try
- {
- result = Enum.Parse(enumType, value);
- return true;
- }
-#pragma warning disable CA1031 // Do not catch general exception types
- catch
-#pragma warning restore CA1031 // Do not catch general exception types
- {
- result = null;
- return false;
- }
- }
-#endif
+ [NotNullWhen(true)] string? value,
+ out object? result) => Enum.TryParse(enumType, value, out result);
///
/// Converts the Schema URI representation of the enum type to an equivalent enumerated object.
@@ -53,36 +31,19 @@ public static bool TryParse(
/// if the conversion succeeded; otherwise.
public static bool TryParseEnumFromSchemaUri(
Type enumType,
-#if NETCOREAPP3_1_OR_GREATER
- [NotNullWhen(true)]
-#endif
- string? value,
+ [NotNullWhen(true)] string? value,
out object? result)
{
-#if NET
ArgumentNullException.ThrowIfNull(enumType);
-#else
- if (enumType is null)
- {
- throw new ArgumentNullException(nameof(enumType));
- }
-#endif
+
string? enumString;
if (value is not null && value.Length > Constants.HttpSchemaOrgUrl.Length && value.StartsWith(Constants.HttpSchemaOrgUrl, StringComparison.OrdinalIgnoreCase))
{
-#if NETCOREAPP3_0_OR_GREATER
enumString = value[(Constants.HttpSchemaOrgUrl.Length + 1)..];
-#else
- enumString = value.Substring(Constants.HttpSchemaOrgUrl.Length + 1);
-#endif
}
else if (value is not null && value.Length > Constants.HttpsSchemaOrgUrl.Length && value.StartsWith(Constants.HttpsSchemaOrgUrl, StringComparison.OrdinalIgnoreCase))
{
-#if NETCOREAPP3_0_OR_GREATER
enumString = value[(Constants.HttpsSchemaOrgUrl.Length + 1)..];
-#else
- enumString = value.Substring(Constants.HttpsSchemaOrgUrl.Length + 1);
-#endif
}
else
{
diff --git a/Source/Common/FastActivator.cs b/Source/Schema.NET.Common/FastActivator.cs
similarity index 97%
rename from Source/Common/FastActivator.cs
rename to Source/Schema.NET.Common/FastActivator.cs
index 86323569..f3099ab8 100644
--- a/Source/Common/FastActivator.cs
+++ b/Source/Schema.NET.Common/FastActivator.cs
@@ -56,6 +56,6 @@ private static Func CreateConstructorDelegate(ConstructorInfo co
private static class ConstructorParameter
{
- public static readonly ParameterExpression[] SingleParameter = new[] { Expression.Parameter(typeof(T1)) };
+ public static readonly ParameterExpression[] SingleParameter = [Expression.Parameter(typeof(T1))];
}
}
diff --git a/Source/Common/HashCode.cs b/Source/Schema.NET.Common/HashCode.cs
similarity index 100%
rename from Source/Common/HashCode.cs
rename to Source/Schema.NET.Common/HashCode.cs
diff --git a/Source/Common/IValues.cs b/Source/Schema.NET.Common/IValues.cs
similarity index 100%
rename from Source/Common/IValues.cs
rename to Source/Schema.NET.Common/IValues.cs
diff --git a/Source/Common/JsonLdContext.cs b/Source/Schema.NET.Common/JsonLdContext.cs
similarity index 100%
rename from Source/Common/JsonLdContext.cs
rename to Source/Schema.NET.Common/JsonLdContext.cs
diff --git a/Source/Common/JsonLdObject.cs b/Source/Schema.NET.Common/JsonLdObject.cs
similarity index 100%
rename from Source/Common/JsonLdObject.cs
rename to Source/Schema.NET.Common/JsonLdObject.cs
diff --git a/Source/Common/OneOrMany{T}.cs b/Source/Schema.NET.Common/OneOrMany{T}.cs
similarity index 90%
rename from Source/Common/OneOrMany{T}.cs
rename to Source/Schema.NET.Common/OneOrMany{T}.cs
index 1b37ae2d..7aaa6daf 100644
--- a/Source/Common/OneOrMany{T}.cs
+++ b/Source/Schema.NET.Common/OneOrMany{T}.cs
@@ -3,7 +3,11 @@ namespace Schema.NET;
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
+using System.Runtime.CompilerServices;
///
/// A single or list of values.
@@ -25,7 +29,7 @@ public OneOrMany(T? item)
{
if (item is null || (item is string itemAsString && string.IsNullOrWhiteSpace(itemAsString)))
{
- this.collection = null;
+ this.collection = [];
this.HasOne = false;
}
else
@@ -53,7 +57,7 @@ public OneOrMany(ReadOnlySpan span)
var item = span[i];
if (!string.IsNullOrWhiteSpace(item as string))
{
- items[index] = item!;
+ items[index] = item;
index++;
}
}
@@ -88,7 +92,7 @@ public OneOrMany(ReadOnlySpan span)
}
}
- this.collection = null;
+ this.collection = [];
this.HasOne = false;
}
@@ -96,28 +100,19 @@ public OneOrMany(ReadOnlySpan span)
/// Initializes a new instance of the struct.
///
/// The array of values.
- public OneOrMany(params T?[] array)
- : this(array.AsSpan())
- {
- }
+ public OneOrMany(params T?[] array) : this(array.AsSpan()) { }
///
/// Initializes a new instance of the struct.
///
/// The collection of values.
- public OneOrMany(IEnumerable collection)
- : this(collection.ToArray().AsSpan())
- {
- }
+ public OneOrMany(IEnumerable collection) : this(collection.ToArray().AsSpan()) { }
///
/// Initializes a new instance of the struct.
///
/// The list of values.
- public OneOrMany(IEnumerable