Proyecto con operaciones CRUD sobre MongoDb expuestas en una WebApi hecha con ASP.NET Core 3.1*
Videos Youtube (π π²π―.ππ€π³ π’πππΎ πΆπΎπ»π ππ + π¬πππππ£π‘ πππ)
- MongoDb Server Community
- MongoDb Compass
- Visual Studio 2019 Community
- .net Core
- Postman free
- SoapUI Open source
services.Configure<ClientesStoreDatabaseSettings>(
Configuration.GetSection(nameof(ClientesStoreDatabaseSettings)));
services.AddSingleton<IClientesStoreDatabaseSettings>(sp =>
sp.GetRequiredService<IOptions<ClientesStoreDatabaseSettings>>().Value);
services.AddSingleton<ClientesDb>();
services.AddSingleton<ClientesDbAsync>();
services.AddSingleton<ClientesDbQueryable>();
// http://mongodb.github.io/mongo-csharp-driver/2.0/reference/driver/connecting/#re-use
services.AddSingleton<IClientSettingsService, ClientSettingsServiceMongoDB>();
- http://localhost:5000/api/clientes/5eac64158a01245a2c89fb0c
- http://localhost:5000/api/clientesiq/getbydir/123
- http://localhost:5000/api/clientesasync
{
"nombre": "Cliente 1",
"apellido": "Apellido 1",
"edad": 37,
"telefonos": [
{
"id": 1,
"tel": "+555555555555"
},
{
"id": 2,
"tel": "+111111111111"
},
{
"id": 3,
"tel": "+222222222222"
},
{
"id": 4,
"tel": "+999999999999"
}
],
"direccionCliente": {
"id": 0,
"calle": "Calle 123",
"numero": "133",
"depto": "3a"
}
}
{
"id": "{Id Creado}",
"nombre": "Cliente 1 12345",
"apellido": "Apellido 1",
"edad": 37,
"telefonos": [
{
"id": 1,
"tel": "+555555555555"
},
{
"id": 2,
"tel": "+111111111111"
},
{
"id": 3,
"tel": "+222222222222"
},
{
"id": 4,
"tel": "+999999999999"
}
],
"direccionCliente": {
"calle": "Calle 123",
"numero": "133",
"depto": "3a"
}
}
- CREATE_POST.json
- UPDATE_PUT.json