1.源码
.net使用MongDB数据库-C#文档类资源-CSDN下载
2.过程
using Microsoft.AspNetCore.Mvc;
using TestMongoDB.Entity;
using TestMongoDB.Help;
namespace TestMongoDB.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public MongoDBHelp _helpMongDb;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
//初始化连接
|