鉴于我的代码的上下文片段:
var calibration = new Calibration
{
CalibrationType = SelectedTest.TestTypeId
,Expiration = expirationDate
,LastSaved = DateTime.Now
,StatusTypeId = 1
,TechnicianId = SelectedTechnician.Id
,Phases = BuildCalibrationPhases()
};
db.Calibrations.Add(calibration);
db.SaveChanges();
实体框架有没有办法在完成后获取为校准对象选择(播种)的主键db.SaveChanges();
?
换句话说,在提交后如何获取该对象的主键?