-
Type: Bug
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Dotnet Drivers
Summary
When attempting to run the code below a NullReferenceException is thrown
Driver: 2.24.0
How to Reproduce
Run the following test:
_public class MongoTest
{
[Fact]
public async Task Test()
{
var settings = MongoClientSettings.FromConnectionString("
");
settings.ServerApi = new ServerApi(ServerApiVersion.V1);
settings.LinqProvider = MongoDB.Driver.Linq.LinqProvider.V3; var mongoClient = new MongoClient(settings); var db = mongoClient.GetDatabase("DB"); var collection = db.GetCollection<Record>(nameof(Record)); var result = await collection.UpdateOneAsync(
Builders<Record>.Filter.Empty,
Builders<Record>.Update.Pipeline(PipelineDefinitionBuilder.For<Record>()
.Set(record => new Record
{
DurationInMinutes = DateTime.UtcNow.Subtract(record.StartTime, DateTimeUnit.Minute)
})));
} private class Record
{
public DateTime StartTime
public double DurationInMinutes { get; set; }
}
}_
Additional Background
Please provide any additional background information that may be helpful in diagnosing the bug.
- depends on
-
CSHARP-3315 LINQ3: Serializers should implement Equals
- Closed