System.InvalidOperationException:“This MySqlConnection is already in use. See https://fl.vu/mysql-conn-reuse”
出错
var applicationform = db.ApplicationForm.Where(x => applicationformids.Contains(x.id)); foreach (var item in applicationform) { var supply = realNeedApplyList.Single(x => x.applicationformid == item.id);//这里出错 。。。。。 }
解决办法加.ToList()
var applicationform = db.ApplicationForm.Where(x => applicationformids.Contains(x.id)); foreach (var item in applicationform.ToList()) { var supply = realNeedApplyList.Single(x => x.applicationformid == item.id); 。。。。。 }