@@ -20,38 +20,78 @@ Examples
20
20
21
21
These examples use the following ``Restaurant`` class as a model:
22
22
23
- .. literalinclude:: ../includes/code-examples/Find .cs
23
+ .. literalinclude:: ../includes/code-examples/FindOneSync .cs
24
24
:start-after: start-model
25
25
:end-before: end-model
26
26
:language: csharp
27
27
:copyable:
28
28
:dedent:
29
29
30
- Find a Document Using Builders
31
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30
+ .. tabs::
32
31
33
- The following example uses builders to find a document in the ``restaurants``
34
- collection with the ``name`` "Bagels N Buns".
32
+ .. tab:: Builders Async
33
+ :tabid: builders-async
35
34
36
- .. literalinclude:: ../includes/code-examples/Find.cs
37
- :start-after: start-find-builders
38
- :end-before: end-find-builders
39
- :language: csharp
40
- :copyable:
41
- :dedent:
35
+ Find a Document Using Builders
36
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42
37
43
- Find a Document Using LINQ
44
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
38
+ The following example uses builders to asynchronously find a document in
39
+ the ``restaurants`` collection with the ``name`` "Bagels N Buns".
45
40
46
- The following example uses LINQ to find a document in the ``restaurants``
47
- collection with the ``name`` "Bagels N Buns".
41
+ .. literalinclude:: ../includes/code-examples/FindOneAsync.cs
42
+ :start-after: start-find-builders
43
+ :end-before: end-find-builders
44
+ :language: csharp
45
+ :copyable:
46
+ :dedent:
48
47
49
- .. literalinclude:: ../includes/code-examples/Find.cs
50
- :start-after: start-find-linq
51
- :end-before: end-find-linq
52
- :language: csharp
53
- :copyable:
54
- :dedent:
48
+ .. tab:: Builders Synchronous
49
+ :tabid: builders-sync
50
+
51
+ Find a Document Using Builders
52
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53
+
54
+ The following example uses builders to synchronously find a document in the ``restaurants``
55
+ collection with the ``name`` "Bagels N Buns".
56
+
57
+ .. literalinclude:: ../includes/code-examples/FindOneSync.cs
58
+ :start-after: start-find-builders
59
+ :end-before: end-find-builders
60
+ :language: csharp
61
+ :copyable:
62
+ :dedent:
63
+
64
+ .. tab:: LINQ Async
65
+ :tabid: linq-async
66
+
67
+ Find a Document Using LINQ
68
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
69
+
70
+ The following example uses LINQ to asynchronously find a document in the ``restaurants``
71
+ collection with the ``name`` "Bagels N Buns".
72
+
73
+ .. literalinclude:: ../includes/code-examples/FindOneAsync.cs
74
+ :start-after: start-find-linq
75
+ :end-before: end-find-linq
76
+ :language: csharp
77
+ :copyable:
78
+ :dedent:
79
+
80
+ .. tab:: LINQ Synchronous
81
+ :tabid: linq-sync
82
+
83
+ Find a Document Using LINQ
84
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
85
+
86
+ The following example uses LINQ to synchronously find a document in the ``restaurants``
87
+ collection with the ``name`` "Bagels N Buns".
88
+
89
+ .. literalinclude:: ../includes/code-examples/FindOneSync.cs
90
+ :start-after: start-find-linq
91
+ :end-before: end-find-linq
92
+ :language: csharp
93
+ :copyable:
94
+ :dedent:
55
95
56
96
Expected Result
57
97
~~~~~~~~~~~~~~~
@@ -89,4 +129,4 @@ To learn more about LINQ, see <LINQ page>.
89
129
API Documentation
90
130
~~~~~~~~~~~~~~~~~
91
131
92
- `Find() <{+api+}/html/Overload_MongoDB_Driver_IMongoCollectionExtensions_Find.htm>`__
132
+ `Find() <{+api-root +}/html/Overload_MongoDB_Driver_IMongoCollectionExtensions_Find.htm>`__
0 commit comments