Skip to content

Commit

Permalink
Feature/nodatime 3 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetious committed Sep 28, 2021
1 parent d7a3b3a commit 644e19d
Show file tree
Hide file tree
Showing 7 changed files with 7,191 additions and 17 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# MongoDb.Bson.NodaTime
BsonSerializers for NodaTime types, for use with the MongoDB C# driver.

# Supported NodaTime versions

The major version of MongoDb.Bson.NodaTime is in sync with the major version of NodaTime.

# Installation
Grab the latest package from Nuget. Yay, Nuget!

Expand All @@ -23,7 +27,6 @@ individually like this:
BsonSerializer.RegisterSerializer(new InstantSerializer());
```

# Special case for Instant, as of v3.0.0

By default, Instants are serialized to be compatible with Mongo's underling Date representation, which is limited to ms
Expand All @@ -44,8 +47,3 @@ This will likely break certain types of aggregations, as well as greater than/le
* Duration
* ZonedDateTime
* Offset

# Dependencies

* NodaTime v1.3.2 for 1.3.0, v2.2.0 thereafter
* MongoDB.Driver v2.2.4
10 changes: 4 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
version: 3.0.0-{build}
os: Visual Studio 2019
configuration: Release
os: Ubuntu2004
before_build:
- dotnet restore
- dotnet restore --use-lock-file
build_script:
- dotnet pack src/MongoDb.Bson.NodaTime/ -c %CONFIGURATION%
- dotnet pack src/MongoDb.Bson.NodaTime/ -c Release
test_script:
- dotnet test test/MongoDb.Bson.NodaTime.Tests/MongoDb.Bson.NodaTime.Tests.csproj -f netcoreapp1.1
- dotnet test test/MongoDb.Bson.NodaTime.Tests/MongoDb.Bson.NodaTime.Tests.csproj -f net452
- dotnet test test/MongoDb.Bson.NodaTime.Tests/MongoDb.Bson.NodaTime.Tests.csproj
artifacts:
- path: src\MongoDb.Bson.NodaTime\bin\Release\*.nupkg
name: nuget
6 changes: 3 additions & 3 deletions src/MongoDb.Bson.NodaTime/MongoDb.Bson.NodaTime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyTitle>MongoDb.Bson.NodaTime</AssemblyTitle>
<VersionPrefix>3.0.0</VersionPrefix>
<Authors>Greg Lincoln</Authors>
<TargetFrameworks>netstandard1.5;net452</TargetFrameworks>
<TargetFrameworks>netstandard2</TargetFrameworks>
<AssemblyName>MongoDb.Bson.NodaTime</AssemblyName>
<PackageId>MongoDb.Bson.NodaTime</PackageId>
<PackageTags>nodatime;bson;mongodb;mongo</PackageTags>
Expand All @@ -17,8 +17,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Bson" Version="2.11.4" />
<PackageReference Include="NodaTime" Version="2.4.11" />
<PackageReference Include="MongoDB.Bson" Version="2.13.1" />
<PackageReference Include="NodaTime" Version="3.0.6" />
</ItemGroup>

</Project>
44 changes: 44 additions & 0 deletions src/MongoDb.Bson.NodaTime/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": 1,
"dependencies": {
".NETStandard,Version=v2.0": {
"MongoDB.Bson": {
"type": "Direct",
"requested": "[2.13.1, )",
"resolved": "2.13.1",
"contentHash": "B/AI2we7YwfFuNcXr4jlCnVI5dJp+g8vkyj3Shi/bOpGhZQaxW4jK/NiiTwYvqxaMOe4MtVR+6Zlk4D2zalC7A==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "5.0.0"
}
},
"NETStandard.Library": {
"type": "Direct",
"requested": "[2.0.3, )",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"NodaTime": {
"type": "Direct",
"requested": "[3.0.6, )",
"resolved": "3.0.6",
"contentHash": "Jt+qjGV7YW3HoYAT4/MTKGI5+mw6hS+mqOr33hJB/NSacdO0QK2tnSTcmqtv7S3kgl7hYUfN/qaYW70D+o9tpQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.7.1"
}
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA=="
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>MongoDb.Bson.NodaTime.Tests Library</Description>
<Authors>Greg Lincoln</Authors>
<TargetFrameworks>netcoreapp3.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<AssemblyName>MongoDb.Bson.NodaTime.Tests</AssemblyName>
<PackageId>MongoDb.Bson.NodaTime.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand Down
5 changes: 4 additions & 1 deletion test/MongoDb.Bson.NodaTime.Tests/TestHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using MongoDB.Bson;
using Xunit;

[assembly: CollectionBehavior(DisableTestParallelization = true)]

namespace MongoDb.Bson.NodaTime.Tests
{
Expand All @@ -9,4 +12,4 @@ public static string ToTestJson<TType>(this TType obj)
return obj.ToJson().Replace('"', '\'');
}
}
}
}

0 comments on commit 644e19d

Please sign in to comment.