Skip to content

Commit 8d9710e

Browse files
committed
fix test name and improve xml docs
1 parent e998575 commit 8d9710e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/MongoDB.Driver/SortDefinitionBuilder.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ public static SortDefinition<TDocument> MetaTextScore<TDocument>(this SortDefini
131131
public sealed class SortDefinitionBuilder<TDocument>
132132
{
133133
/// <summary>
134-
/// Creates a value ascending sort.
134+
/// Creates a value ascending sort that sorts documents by their entire document value. For example, "$sort: 1"
135+
/// This is typically used when documents are simple values (like strings, numbers, or dates)
136+
/// rather than complex objects with multiple fields.
135137
/// </summary>
136138
/// <returns>A value ascending sort.</returns>
137139
public SortDefinition<TDocument> Ascending()
@@ -140,7 +142,8 @@ public SortDefinition<TDocument> Ascending()
140142
}
141143

142144
/// <summary>
143-
/// Creates an ascending sort.
145+
/// Creates an ascending sort based on a specific field within the document. For example, "$sort: {field: 1}"
146+
/// This is used when documents are complex objects, and you want to sort by a particular field's value.
144147
/// </summary>
145148
/// <param name="field">The field.</param>
146149
/// <returns>An ascending sort.</returns>
@@ -150,7 +153,8 @@ public SortDefinition<TDocument> Ascending(FieldDefinition<TDocument> field)
150153
}
151154

152155
/// <summary>
153-
/// Creates an ascending sort.
156+
/// Creates an ascending sort based on a specific field within the document. For example, "$sort: {field: 1}"
157+
/// This is used when documents are complex objects, and you want to sort by a particular field's value.
154158
/// </summary>
155159
/// <param name="field">The field.</param>
156160
/// <returns>An ascending sort.</returns>
@@ -180,7 +184,9 @@ public SortDefinition<TDocument> Combine(IEnumerable<SortDefinition<TDocument>>
180184
}
181185

182186
/// <summary>
183-
/// Creates a value descending sort.
187+
/// Creates a value descending sort that sorts documents by their entire document value. For example, "$sort: -1"
188+
/// This is typically used when documents are simple values (like strings, numbers, or dates)
189+
/// rather than complex objects with multiple fields.
184190
/// </summary>
185191
/// <returns>A value descending sort.</returns>
186192
public SortDefinition<TDocument> Descending()
@@ -189,7 +195,8 @@ public SortDefinition<TDocument> Descending()
189195
}
190196

191197
/// <summary>
192-
/// Creates a descending sort.
198+
/// Creates a descending sort based on a specific field within the document. For example, "$sort: {field: -1}"
199+
/// This is used when documents are complex objects, and you want to sort by a particular field's value.
193200
/// </summary>
194201
/// <param name="field">The field.</param>
195202
/// <returns>A descending sort.</returns>
@@ -199,7 +206,8 @@ public SortDefinition<TDocument> Descending(FieldDefinition<TDocument> field)
199206
}
200207

201208
/// <summary>
202-
/// Creates a descending sort.
209+
/// Creates a descending sort based on a specific field within the document. For example, "$sort: {field: -1}"
210+
/// This is used when documents are complex objects, and you want to sort by a particular field's value.
203211
/// </summary>
204212
/// <param name="field">The field.</param>
205213
/// <returns>A descending sort.</returns>

tests/MongoDB.Driver.Tests/SortDefinitionBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void MetaTextScore()
145145
}
146146

147147
[Fact]
148-
public void CallingRenderOnValueBasedSortShouldThrow()
148+
public void Calling_render_on_value_based_sort_should_throw()
149149
{
150150
var subject = CreateSubject<BsonDocument>();
151151

0 commit comments

Comments
 (0)