Пример #1
0
        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());
        }
Пример #2
0
 public void AddMany(IEnumerable <Learn.Models.Entity.Student> students)
 {
     service.AddMany(students);
 }