//控制器调用
adbll.UpdateAdmin(new Admin { AdminId = AdminId, Name = Name });
//数据层的
using (dbcm = new DBContextManager())
{
Admin an = dbcm.Admins.Single(a => a.AdminId == ad.AdminId);//无id异常
an.Name = ad.Name;
rows = dbcm.SaveChanges();// -----在此出现 验证错误的异常 admin实体数据没有赋值完 没用的就没赋值
}
异常信息
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法