Skip to content

Commit 9425a82

Browse files
authored
Merge pull request #88 from bunq/add_netstandard15_support_bunq/sdk_csharp#26
Added support for netstandard15. (#26)
2 parents a67ca11 + fece097 commit 9425a82

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

BunqSdk/BunqSdk.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<RuntimeFrameworkVersion>1.1.2</RuntimeFrameworkVersion>
4-
<TargetFramework>netcoreapp1.1</TargetFramework>
5-
<OutputType>Library</OutputType>
3+
<TargetFramework>netstandard1.5</TargetFramework>
64
<LangVersion>default</LangVersion>
75
</PropertyGroup>
86
<PropertyGroup>
@@ -26,6 +24,7 @@
2624
</PropertyGroup>
2725
<ItemGroup>
2826
<PackageReference Include="Newtonsoft.Json" Version="10.0.3-*" />
27+
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
2928
</ItemGroup>
3029
<ItemGroup>
3130
<Content Include="../CHANGELOG.md" />

BunqSdk/Json/AnchorObjectConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
3434

3535
if (!model.IsAllFieldNull()) return model;
3636

37-
var fields = objectType.GetProperties();
37+
var fields = objectType.GetTypeInfo().GetProperties();
3838

3939
foreach (var field in fields)
4040
{
4141
var fieldType = field.PropertyType;
4242

43-
if (!typeof(BunqModel).IsAssignableFrom(fieldType))
43+
if (!typeof(BunqModel).GetTypeInfo().IsAssignableFrom(fieldType))
4444
{
4545
continue;
4646
}
@@ -55,7 +55,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
5555

5656
public override bool CanConvert(Type objectType)
5757
{
58-
return typeof(IAnchorObjectInterface).IsAssignableFrom(objectType);
58+
return typeof(IAnchorObjectInterface).GetTypeInfo().IsAssignableFrom(objectType);
5959
}
6060
}
6161
}

BunqSdk/Json/BunqContractResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected override JsonContract CreateContract(Type objectType)
6464

6565
private JsonConverter GetCustomConverterOrNull(Type objectType)
6666
{
67-
if (typeof(IAnchorObjectInterface).IsAssignableFrom(objectType))
67+
if (typeof(IAnchorObjectInterface).GetTypeInfo().IsAssignableFrom(objectType))
6868
{
6969
return converterRegistry.ContainsKey(typeof(IAnchorObjectInterface))
7070
? converterRegistry[typeof(IAnchorObjectInterface)]

0 commit comments

Comments
 (0)