Skip to content

Commit 8cf1d8e

Browse files
committed
upgrade to .net 9.0.203
1 parent 92268ee commit 8cf1d8e

File tree

12 files changed

+135
-109
lines changed

12 files changed

+135
-109
lines changed

.github/workflows/on-push-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup .NET Core
1818
uses: actions/setup-dotnet@v4.2.0
1919
with:
20-
dotnet-version: 9.0.200
20+
dotnet-version: 9.0.203
2121

2222
- name: Build & Test
2323
run: make test config=Release

.github/workflows/on-push-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup .NET Core
2525
uses: actions/setup-dotnet@v4.2.0
2626
with:
27-
dotnet-version: 9.0.200
27+
dotnet-version: 9.0.203
2828

2929
- name: Extract Version Suffix
3030
run: |

.github/workflows/on-release-published.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup .NET Core
1414
uses: actions/setup-dotnet@v4.2.0
1515
with:
16-
dotnet-version: 9.0.200
16+
dotnet-version: 9.0.203
1717

1818
- name: Download Release artifacts
1919
uses: robinraju/release-downloader@v1.11

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ test:
1010

1111
nuget:
1212
dotnet pack -c $(config) -p:Version=$(version) -o .out
13+
14+
upgrade:
15+
dotnet restore --force-evaluate

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.203"
4+
}
5+
}

src/FSharp.MongoDB.Bson/FSharp.MongoDB.Bson.fsproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>net9.0;net8.0;netstandard2.1</TargetFrameworks>
@@ -26,8 +26,7 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="MongoDB.Bson" Version="3.1.0" />
30-
<!-- <ProjectReference Include="../../../mongo-csharp-driver/src/MongoDB.Bson/MongoDB.Bson.csproj" /> -->
29+
<PackageReference Include="MongoDB.Bson" Version="3.4.0" />
3130
</ItemGroup>
3231

3332
<PropertyGroup>

src/FSharp.MongoDB.Bson/Serialization/FSharpTypeHelpers.fs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,12 @@ module private Helpers =
9898
/// <summary>
9999
/// Maps a member of a <c>BsonClassMap</c> to a nullable value if possible.
100100
/// </summary>
101-
let mapMemberNullable (memberMap: BsonClassMap) (propertyInfo: PropertyInfo) =
102-
memberMap.MapMember(propertyInfo) |> ignore
101+
let mapMemberNullable (classMap: BsonClassMap) (propertyInfo: PropertyInfo) =
102+
let memberMap = classMap.MapMember(propertyInfo)
103+
#if !NETSTANDARD2_1
104+
let nrtInfo = nrtContext.Create(propertyInfo)
105+
if nrtInfo.WriteState = NullabilityState.Nullable then
106+
memberMap.SetDefaultValue(objnull) |> ignore
107+
#else
108+
()
109+
#endif

src/FSharp.MongoDB.Bson/Serialization/Serializers/FSharpOptionSerializer.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ type FSharpOptionSerializer<'T when 'T: not null>() =
4040

4141
match reader.GetCurrentBsonType() with
4242
| BsonType.Null -> reader.ReadNull(); None
43-
| _ -> Some (serializer.Value.Deserialize(context, args))
43+
| t -> Some (serializer.Value.Deserialize(context, args))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="MongoDB.Bson" Version="3.1.0" />
11+
<PackageReference Include="MongoDB.Bson" Version="3.4.0" />
1212
</ItemGroup>
1313

1414
</Project>

tests/CSharpDataModels/DataModels.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ public record PairValue(Pair Value) : Value;
1818

1919
public record RecordDataModel
2020
{
21-
public ObjectId Id { get; init; }
22-
23-
public required int Int { get; init; }
24-
public int? IntOpt { get; init; }
25-
26-
public required string String { get; init; }
27-
public string? StringOpt { get; init; }
28-
29-
public required int[] Array { get; init; }
30-
public int[]? ArrayOpt { get; init; }
31-
32-
public required Value Value { get; init; }
33-
public Value? ValueOpt { get; init; }
34-
35-
public required Value[] ValueArray { get; init; }
36-
public Value[]? ValueArrayOpt { get; init; }
37-
38-
public required Pair Record { get; init; }
21+
// public ObjectId Id { get; init; }
22+
//
23+
// public required int Int { get; init; }
24+
// public int? IntOpt { get; init; }
25+
//
26+
// public required string String { get; init; }
27+
// public string? StringOpt { get; init; }
28+
//
29+
// public required int[] Array { get; init; }
30+
// public int[]? ArrayOpt { get; init; }
31+
32+
// public required Value Value { get; init; }
33+
// public Value? ValueOpt { get; init; }
34+
35+
// public required Value[] ValueArray { get; init; }
36+
// public Value[]? ValueArrayOpt { get; init; }
37+
38+
// public required Pair Record { get; init; }
3939
public Pair? RecordOpt { get; init; }
4040

41-
public required Dictionary<string, int> Map { get; init; }
41+
// public required Dictionary<string, int> Map { get; init; }
4242
}

0 commit comments

Comments
 (0)