Skip to content

Commit b4865fc

Browse files
Update to dotnet sdk 8 (#770)
* Update to dotnet sdk 8 * install 6.0 sdk on 8.0 image * Add 8.0 targets to driver projects
1 parent ca3700e commit b4865fc

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

Neo4j.Driver/Neo4j.Driver.Reactive/Neo4j.Driver.Reactive.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\common.props"/>
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;netstandard2.0;net8.0</TargetFrameworks>
55
<AssemblyName>Neo4j.Driver.Reactive</AssemblyName>
66
<PackageId>Neo4j.Driver.Reactive$(PackageIdSuffix)</PackageId>
77
<Authors>Neo4j</Authors>

Neo4j.Driver/Neo4j.Driver.Simple/Neo4j.Driver.Simple.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\common.props"/>
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;netstandard2.0;net8.0</TargetFrameworks>
55
<PackageId>Neo4j.Driver.Simple$(PackageIdSuffix)</PackageId>
66
<Authors>Neo4j</Authors>
77
<Description>Synchronous extensions for the official .NET driver.</Description>

Neo4j.Driver/Neo4j.Driver.Tests/Mapping/RecordMappingTests.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,34 @@ public void ShouldMapToInitProperties()
460460
person.Name.Should().Be("Bob");
461461
person.Age.Should().Be(1977);
462462
}
463+
464+
private class ClassWithDefaultConstructor(string forename, int age)
465+
{
466+
public string Name => forename;
467+
public int Age => age;
468+
}
469+
470+
[Fact]
471+
public void ShouldMapToDefaultConstructorParameters()
472+
{
473+
var record = new Record(new[] { "forename", "age" }, new object[] { "Bob", 1977 });
474+
var person = record.AsObject<ClassWithDefaultConstructor>();
475+
person.Name.Should().Be("Bob");
476+
person.Age.Should().Be(1977);
477+
}
478+
479+
private class ClassWithDefaultConstructorWithAttributes([MappingSource("forename")] string name, int age)
480+
{
481+
public string Name => name;
482+
public int Age => age;
483+
}
484+
485+
[Fact]
486+
public void ShouldMapToDefaultConstructorParametersWithAttributes()
487+
{
488+
var record = new Record(new[] { "forename", "age" }, new object[] { "Bob", 1977 });
489+
var person = record.AsObject<ClassWithDefaultConstructorWithAttributes>();
490+
person.Name.Should().Be("Bob");
491+
person.Age.Should().Be(1977);
492+
}
463493
}

Neo4j.Driver/Neo4j.Driver.Tests/Neo4j.Driver.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<GenerateAssemblyVersionAttribute>true</GenerateAssemblyVersionAttribute>
1414
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
1515
<TargetFramework>net6.0</TargetFramework>
16+
<LangVersion>preview</LangVersion>
1617
</PropertyGroup>
1718
<ItemGroup>
1819
<Content Include="App.config" />

Neo4j.Driver/Neo4j.Driver/Neo4j.Driver.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Neo4j.Driver.xml</DocumentationFile>
2525
<Version>5.16.0</Version>
2626
<LangVersion>10.0</LangVersion>
27-
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
27+
<TargetFrameworks>net6.0;netstandard2.0;net8.0</TargetFrameworks>
2828
</PropertyGroup>
2929
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
3030
<WarningLevel>2</WarningLevel>

testkit/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
22

33
RUN apt update \
44
&& ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime \
@@ -10,6 +10,10 @@ RUN apt update \
1010
&& apt install -y python3 \
1111
&& rm -rf /var/lib/apt/lists/*
1212

13+
# install .NET runtime 6.0.0
14+
RUN wget https://dot.net/v1/dotnet-install.sh
15+
RUN bash dotnet-install.sh --channel 6.0 --install-dir /usr/share/dotnet
16+
1317
ENV PYTHON=python3
1418
ENV DOTNET_DRIVER_USING_LOCAL_SERVER=true
1519
ENV TEST_NEO4J_USING_TESTKIT=true

0 commit comments

Comments
 (0)