Create a RESTful API with .NET Core and MongoDB

preview_player
Показать описание

Want to build a web application with .NET Core and MongoDB? In this video tutorial, Nic Raboy shows how to build a RESTful web API with various CRUD endpoints that interact with MongoDB Atlas.

Рекомендации по теме
Комментарии
Автор

I've been following the entire guide and was stuck with a problem of Swagger not recognizing my endpoints ("No operations defined in spec!"). Eventually, I figured it out. In case anyone else has the same problem, I've changed "[Controller]" to "[ApiController]" in PlaylistController.cs file. Other than that, thank you for your video!

danielsosinskiy
Автор

00:35= Prequisite Softwares, 01:17= Command to create new Web Api, 02:55= Create Module, Model-> MongoDBSettings.cs file, 04:30= appsettings.json, 06:25=ConnectionURL, 07:13= Services Module, 08:15= Read Only, 09:14= PlayList.cs, 17:20= Controller Module, 23:30= MongoDb Service, 24:46=Start From Here,

narutodihargo
Автор

Hey thank you for the video! I'm running into a CORS problem when trying to execute the GET request. What could I be doing wrong? (can't seem to find any answers on google)

Edit: nevermind, it seemed to resolve itself, i think i cant make too many calls/requests to MongoDB in a short time maybe?

leighton_lam
Автор

Great video, made changes to meet my own local MongoDB server.

charlesm.
Автор

Incredibly helpful video! great job and thank you!

one question though, what's the mechanism in this approach for accessing another collection within the database? in this example you've hard coded the CollectionName to be "playlist" in the appsettings.json file. what do you do to access the "movies" and "theaters" collection from your sample_mflix database?

pilgrimk
Автор

There's one problem at PUT method. When you try to update a document, it add a new item instead of updating the value of the current item.

zutafe
Автор

So MongoDB service is basically like a repository if we use a repository pattern as you are in contact with database when you are in MongoDbService.

sniperharshgaming
Автор

Hello I have this error Internal server error: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1. can you help me?

kurtaaroncabrera
Автор

Usted es la verga mi llave, gracias. Encima como me gusta con vs code y con cmd.

mauroinde
Автор

cant even create a simple upsert, swagger always shits out: Unable to cast object of type 'MongoDB.Bson.BsonObjectId' to type 'MongoDB.Bson.BsonBoolean'.
at AsBooleanGetter(Object)

botyironcastle