Skip to content

Commit

Permalink
feat: add JSON conversion support for Iban type for .NET Std 2.1 (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer authored Oct 2, 2024
1 parent 51842d7 commit b802059
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/IbanNet/Iban.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace IbanNet;
/// Represents an IBAN.
/// </summary>
[TypeConverter(typeof(IbanTypeConverter))]
#if NET6_0_OR_GREATER
#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
[System.Text.Json.Serialization.JsonConverter(typeof(Json.IbanJsonConverter))]
#endif
public sealed class Iban
Expand Down
1 change: 1 addition & 0 deletions src/IbanNet/IbanNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="6.0.9" Condition="'$(TargetFramework)'=='netstandard2.1'" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IbanNet/Json/IbanJsonConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET6_0_OR_GREATER
#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
using System.Text.Json;
using System.Text.Json.Serialization;
using IbanNet.Registry;
Expand Down
2 changes: 1 addition & 1 deletion test/IbanNet.Tests/Json/IbanJsonConverterTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET6_0_OR_GREATER
#if NET5_0_OR_GREATER
using System.Text;
using System.Text.Json;
using IbanNet.Registry;
Expand Down

0 comments on commit b802059

Please sign in to comment.