2022年1月25日 星期二

發佈專案遇到錯誤 : project.assets.json' 沒有 'netcoreapp3.1' 的目標

可能是專案從 3.1 升級到 6.0 會遇到此問題

請確認是否已安裝 nuget 目標與建置工作,並確認專案檔內容是否相關套件都升級到6.0



Entity Framework 建立新物件並儲存後馬上取得關聯資料

使用 CreateProxy 建立物件,不要直接 new var newmodel = _contextXXX.CreateProxy<yyy>(); ... _contextXXX.yyy.Add(newmodel); await _contextXXX.SaveC...