/// <summary> /// 儲存所有變更儲存到基礎資料庫。(跨 Repository,並使用資料庫交易) /// </summary> public void SaveChanges() { try { DbFactory.BeginTransaction(); DbFactory.Get().SaveChanges(); DbFactory.Commit(); } catch { DbFactory.Rollback(); ObjectContext.Connection.Close(); Dispose(); throw; } }