@@ -55,6 +55,7 @@ Microsoft offers. To do this, run the following commands in your terminal:
5555To add the {+driver-short+} to your project as a dependency, run the following command:
5656
5757.. code-block:: bash
58+
5859 dotnet add package MongoDB.Driver
5960
6061The preceding commands create a new web application project for .NET core named
@@ -82,7 +83,7 @@ the data model for your RESTful API.
8283 :language: csharp
8384 :dedent:
8485
85- The precedeing code defines a class named ``MongoDBSettings`` that
86+ The preceding code defines a class named ``MongoDBSettings`` that
8687 contains information about your connection, the database name, and the
8788 collection name.
8889
@@ -178,4 +179,33 @@ the data model for your RESTful API.
178179 be ``username`` in C#, in JSON, and in MongoDB.
179180
180181You now have a MongoDB service and document model for your collection to work
181- with for .NET Core.
182+ with for .NET Core.
183+
184+ Build CRUD Endpoints
185+ --------------------
186+
187+ To create the CRUD endpoints for this application, you need to update two
188+ different files within the project. In this section, you can learn how to define
189+ the endpoint within a controller and update the corresponding work within the
190+ service.
191+
192+ .. procedure:: Build endpoints to interact with MongoDB
193+ :style: connected
194+
195+ .. step:: Create a controller
196+
197+ In your project, create a folder named ``Controllers``. In the
198+ ``Controllers`` folder, create a new file named ``PlaylistController.cs``
199+ and add the following code:
200+
201+ .. literalinclude:: /includes/fundamentals/code-examples/restful-api-tutorial/PlaylistControllerSetup.cs
202+ :language: csharp
203+ :dedent:
204+
205+ The ``PlaylistController`` class contains a constructor method that gains
206+ access to your singleton service class. Then, there is a series of
207+ endpoints for this controller.
208+
209+ .. step:: Add data through the POST endpoing
210+
211+ Navigate to ``Services/MongoDBService.cs`` and add the following code:
0 commit comments