Skip to content

Commit

Permalink
Merge pull request #207 from ali-ince/1.5
Browse files Browse the repository at this point in the history
support .net framework 4.5 alongside .net standard 1.3 platforms
  • Loading branch information
ali-ince committed Aug 1, 2017
2 parents 529c70c + fdbd015 commit 9fd27c1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,13 @@ public void Close()
public Task CloseAsync()
{
Close();
return Task.CompletedTask; // TODO verify this is the correct way to do it

// TODO verify this is the correct way to do it
#if NET45
return Task.FromResult(0);
#else
return Task.CompletedTask;
#endif
}

private void AssertNoServerFailure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ protected virtual void Dispose(bool isDisposing)
private void Close()
{
_stream?.Dispose();

#if NET45
_client?.Close();
#else
_client?.Dispose();
#endif
}

/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
Expand Down
4 changes: 4 additions & 0 deletions Neo4j.Driver/Neo4j.Driver/Internal/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ public override void Close()
public override Task CloseAsync()
{
Close();
#if NET45
return Task.FromResult(0);
#else
return Task.CompletedTask;
#endif
}

public override void OnError(Exception error)
Expand Down
10 changes: 4 additions & 6 deletions Neo4j.Driver/Neo4j.Driver/Neo4j.Driver.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<AssemblyName>Neo4j.Driver</AssemblyName>
<PackageId>Neo4j.Driver</PackageId>
<Authors>Neo4j</Authors>
Expand Down Expand Up @@ -32,14 +32,12 @@
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard1.3|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.3\Neo4j.Driver.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Net.Security" Version="4.3.1" />
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Net.Security" Version="4.3.1" />
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
</ItemGroup>

</Project>

0 comments on commit 9fd27c1

Please sign in to comment.