日誌中出現Entity Framework修改資料庫時的錯誤:
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
從表面看不出來哪裡錯了,增加以下try...catch程式碼,捕獲異常:
try { // 資料庫操作 } catch (DbEntityValidationException ex) { }
最終在ex.EntityValidationErrors中找到,是因為增加的資料超出了最大長度限制!