@@ -18,7 +18,7 @@ public RestaurantsController(IMongoClient client)
18
18
. AsQueryable ( ) ;
19
19
}
20
20
21
- // Register Get endpoint and set max documents to 5
21
+ // Registers Get endpoint and sets max documents to 5
22
22
[ MongoEnableQuery ( PageSize = 5 ) ]
23
23
public ActionResult < IEnumerable < Restaurant > > Get ( )
24
24
{
@@ -36,22 +36,22 @@ public ActionResult<IEnumerable<Restaurant>> Get()
36
36
37
37
var builder = WebApplication . CreateBuilder ( args ) ;
38
38
39
- // Register a convention pack to convert fields to camel case
39
+ // Registers a convention pack to convert fields to camel case
40
40
var camelCaseConvention = new ConventionPack {
41
41
new CamelCaseElementNameConvention ( )
42
42
} ;
43
43
ConventionRegistry . Register (
44
44
"CamelCase" , camelCaseConvention , type => true ) ;
45
45
46
46
builder . Services . AddSingleton < IMongoClient > (
47
- new MongoClient ( "Your connection URI" ) ) ;
47
+ new MongoClient ( "< Your connection URI> " ) ) ;
48
48
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
50
50
var modelBuilder = new ODataConventionModelBuilder ( ) ;
51
51
modelBuilder . EntitySet < Restaurant > ( "Restaurants" ) ;
52
52
modelBuilder . EntityType < Restaurant > ( ) . HasKey ( r => r . Id ) ;
53
53
54
- // Add OData and specify query capabilities
54
+ // Adds OData and specify query capabilities
55
55
builder . Services . AddControllers ( ) . AddOData (
56
56
options => options . Select ( )
57
57
. AddRouteComponents ( "odata" , modelBuilder . GetEdmModel ( ) )
0 commit comments