- 原版
var model = dbContext.MachineFault.Include(d => d.FaultType)
.ToList();
- 新版
var model = dbContext.MachineFault.ToList();
model.FaultType = dbContext.FaultType.Where(d => d.Id == model.FaultTypeId);
var model = dbContext.MachineFault.Include(d => d.FaultType)
.ToList();
var model = dbContext.MachineFault.ToList();
model.FaultType = dbContext.FaultType.Where(d => d.Id == model.FaultTypeId);
本文标题:1011_替换EF中的include
本文链接:https://www.haomeiwen.com/subject/zphbyttx.html
网友评论