EF批量添加数据之修改SQL Server执行上限

asp.net core 项目

打开Startup.cs

services.AddDbContext<MyContext>(
                options => {
                    options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"),
            opts=> { opts.MaxBatchSize("你随便")});//这里是int类型 //敏感数据记录 options.EnableSensitiveDataLogging(true); });
原文地址:https://www.cnblogs.com/mi21/p/10396609.html