Skip to content

Commit 3283a22

Browse files
Feedback
1 parent d6bff16 commit 3283a22

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

source/fundamentals/odata.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ Tutorial
118118

119119
This code performs the following actions:
120120

121-
- Instantiates a new ``MongoClient`` and passes it to the controller
121+
- Instantiates a new ``MongoClient`` and passes it to the controller.
122122
- Defines the Entity Data Model (EDM) and registers ``Restaurants`` as an
123-
entity set with the key, ``Id``.
123+
entity set with the key ``Id``.
124124
- Adds the OData service and enables the ``Select()`` query capability.
125125
- Registers the route by using the ``AddRouteComponents()`` method.
126126
- Calls the ``UseRouting()`` and ``MapControllers()`` methods to match
@@ -147,7 +147,7 @@ Tutorial
147147
info: Microsoft.Hosting.Lifetime[0]
148148
Hosting environment: Development
149149
info: Microsoft.Hosting.Lifetime[0]
150-
Content root path: /Users/jordan.smith/Documents/mongo/ODataTest/ODataTest
150+
Content root path: <Path to your project>
151151

152152
.. tip::
153153

@@ -190,9 +190,9 @@ Tutorial
190190
...
191191
]
192192
},
193-
193+
194194
...
195-
195+
196196
]
197197
}
198198

source/includes/fundamentals/code-examples/connection/OData.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public RestaurantsController(IMongoClient client)
1818
.AsQueryable();
1919
}
2020

21-
// Register Get endpoint and set max documents to 5
21+
// Registers Get endpoint and sets max documents to 5
2222
[MongoEnableQuery(PageSize = 5)]
2323
public ActionResult<IEnumerable<Restaurant>> Get()
2424
{
@@ -36,22 +36,22 @@ public ActionResult<IEnumerable<Restaurant>> Get()
3636

3737
var builder = WebApplication.CreateBuilder(args);
3838

39-
// Register a convention pack to convert fields to camel case
39+
// Registers a convention pack to convert fields to camel case
4040
var camelCaseConvention = new ConventionPack {
4141
new CamelCaseElementNameConvention()
4242
};
4343
ConventionRegistry.Register(
4444
"CamelCase", camelCaseConvention, type => true);
4545

4646
builder.Services.AddSingleton<IMongoClient>(
47-
new MongoClient("Your connection URI"));
47+
new MongoClient("<Your connection URI>"));
4848

49-
// Register the Restaurants entity and set the Id field as the key
49+
// Registers the Restaurants entity and sets the Id field as the key
5050
var modelBuilder = new ODataConventionModelBuilder();
5151
modelBuilder.EntitySet<Restaurant>("Restaurants");
5252
modelBuilder.EntityType<Restaurant>().HasKey(r => r.Id);
5353

54-
// Add OData and specify query capabilities
54+
// Adds OData and specify query capabilities
5555
builder.Services.AddControllers().AddOData(
5656
options => options.Select()
5757
.AddRouteComponents("odata", modelBuilder.GetEdmModel())

0 commit comments

Comments
 (0)