public IActionResult AddMany([FromBody] dynamic value) { JObject @object = JObject.Parse(value.ToString()); StudentList students = @object.ToObject <StudentList>(); MongodbService <Learn.Models.Entity.Student> mongodbService = new MongodbService <Learn.Models.Entity.Student>("student"); mongodbService.AddMany(students.Students); _logger.LogInformation($"增加了{students.Students.Count}条记录"); return(Ok()); }
public BlogController(MongodbService dbservice) { _dbservice = dbservice; }