You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b99bb19
Browse filesBrowse the repository at this point in the historyBrowse files
- Retarget both projects to net10.0.
- MongoDB.Driver 2.22.0 -> 3.10.0; the four-string Lookup() overload the
sample uses is unchanged at that version.
- Testcontainers.MongoDb 3.6.0 -> 4.14.0. The old version dragged in
SSH.NET 2023.0.0 (NU1903, high severity) and BouncyCastle 2.2.1 (NU1902);
4.x drops both. The parameterless MongoDbBuilder ctor is obsolete in 4.x,
so the image is now pinned explicitly to mongo:8.0.
- Test packages bumped to the versions the recently retargeted samples use
(Microsoft.NET.Test.Sdk 18.9.0, xunit 2.9.3, xunit.runner.visualstudio
2.8.2, coverlet.collector 10.0.1).
- StudentRepository.GetAllUsers() -> GetAllStudentsAsync(). Nothing in this
sample is a user, and the method is async.
- Student.Equals compared course lists with All(...ElementAt(IndexOf(...))),
which throws ArgumentOutOfRangeException when the other student has fewer
courses and is O(n^2). Replaced with SequenceEqual, which uses the
Course.Equals override already present.
- Equality contract: Course.GetHashCode combined Id while Course.Equals
ignores it, and Student had the same asymmetry. Id is now out of both hash
codes, and Student's hash walks StudentCourses so equal students hash
equally instead of hashing the list by reference.
- Dropped the five [Required] DataAnnotations from Course and Student, plus
the now-unused using. The MongoDB driver does not read DataAnnotations and
this is a console app with no model binding, so they implied a validation
guarantee that never existed.
Build and test verified on net10.0 (SDK 10.0.302), 0 warnings, 0 errors.
Copy file name to clipboardExpand all lines: dotnet-mongo-db/JoinCollectionsAggregationPipeline/JoinCollectionsAggregationPipeline.Tests/AggregationPipelineLiveTest.cs
Copy file name to clipboardExpand all lines: dotnet-mongo-db/JoinCollectionsAggregationPipeline/JoinCollectionsAggregationPipeline.Tests/JoinCollectionsAggregationPipeline.Tests.csproj
Copy file name to clipboardExpand all lines: dotnet-mongo-db/JoinCollectionsAggregationPipeline/JoinCollectionsAggregationPipeline/JoinCollectionsAggregationPipeline.csproj
Copy file name to clipboardExpand all lines: dotnet-mongo-db/JoinCollectionsAggregationPipeline/JoinCollectionsAggregationPipeline/StudentRepository.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ public StudentRepository(MongoClient client)
0 commit comments