新增 entity 且 savechanges 後馬上要取得關聯表格的資料會是null

直接 new 物件會有這問題
例如: var model=new 需求單();

請改為透過 Create 產生物件
例如: var model = db.需求單.Create();

留言

熱門文章