Skip to content

Commit

Permalink
Merge pull request #88 from bunq/add_netstandard15_support_bunq/sdk_c…
Browse files Browse the repository at this point in the history
…sharp#26

Added support for netstandard15. (#26)
  • Loading branch information
andrederoos committed Apr 3, 2018
2 parents a67ca11 + fece097 commit 9425a82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions BunqSdk/BunqSdk.csproj
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RuntimeFrameworkVersion>1.1.2</RuntimeFrameworkVersion>
<TargetFramework>netcoreapp1.1</TargetFramework>
<OutputType>Library</OutputType>
<TargetFramework>netstandard1.5</TargetFramework>
<LangVersion>default</LangVersion>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -26,6 +24,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3-*" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<Content Include="../CHANGELOG.md" />
Expand Down
6 changes: 3 additions & 3 deletions BunqSdk/Json/AnchorObjectConverter.cs
Expand Up @@ -34,13 +34,13 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist

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

var fields = objectType.GetProperties();
var fields = objectType.GetTypeInfo().GetProperties();

foreach (var field in fields)
{
var fieldType = field.PropertyType;

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

public override bool CanConvert(Type objectType)
{
return typeof(IAnchorObjectInterface).IsAssignableFrom(objectType);
return typeof(IAnchorObjectInterface).GetTypeInfo().IsAssignableFrom(objectType);
}
}
}
2 changes: 1 addition & 1 deletion BunqSdk/Json/BunqContractResolver.cs
Expand Up @@ -64,7 +64,7 @@ protected override JsonContract CreateContract(Type objectType)

private JsonConverter GetCustomConverterOrNull(Type objectType)
{
if (typeof(IAnchorObjectInterface).IsAssignableFrom(objectType))
if (typeof(IAnchorObjectInterface).GetTypeInfo().IsAssignableFrom(objectType))
{
return converterRegistry.ContainsKey(typeof(IAnchorObjectInterface))
? converterRegistry[typeof(IAnchorObjectInterface)]
Expand Down

0 comments on commit 9425a82

Please sign in to comment.