//添加商家消费记录,消费记录详情表
CorpExpenseRecord cer = new CorpExpenseRecord() { CorpID = lcu.CurrCorp.CorpID, CorpName = lcu.CurrCorp.CorpName, CSID = lcu.CurrCorpShop.CSID, ShopName = lcu.CurrCorpShop.ShopName, ExpensePoints = ExpenseP, ExpenseTypeEF = (byte)ExpenseType.SendECoupon };
_corpExpenseRepository.Add(cer);
base.SaveChange();//保存更改
CorpExpenseRecordDetail cerd = new CorpExpenseRecordDetail() { CERID = cer.CERID, CUID = lcu.CUID, CUName = lcu.CUName, CUNickName = lcu.CUNickName, OrderNo = cso.OrderNo, SendContent = "电子凭证发送" };
_corpExpenseDetailRepository.Add(cerd);
base.SaveChange();//保存更改
下面实体要使用到上面实体的CERID 调试时有值 但是在保存的时候抛出 CERID为空 高银门求解啊
这种情况下在下面实体用到上面实体的CERID值之前要提交一下的