Commit Graph

5 Commits

Author SHA1 Message Date
ae09a6f487 STAGE 3-4 2025-11-12 18:57:51 +08:00
3f63457c5a 修復 memberController.cs 中 nullable 字段的處理
問題:
1. CS1503: mem_num 是 int? 類型,不能直接用於 Contains(int)
2. CS0019: Count 應該使用方法調用 Count()

修復:
- 第 110 行:加入 HasValue 檢查和 .Value 取值
- 第 111 行:使用 Count() 方法而非 Count 屬性

技術說明:
在 LINQ to Entities 中處理 nullable 字段時,必須:
1. 使用 HasValue 檢查是否有值
2. 使用 .Value 取得實際值
3. 確保類型匹配以便正確生成 SQL 查詢

相關文件已正確處理:
✓ accountingController.cs (第 97 行)
✓ stockController.cs (第 92 行)
2025-11-12 17:04:03 +08:00
9a0d5ae700 修復 Batch 1 中 IEnumerable.Contains 的型別轉換問題
問題:
- Split().Select(int.Parse) 返回 IEnumerable<int>
- LINQ to Entities 中使用 Contains 需要具體集合類型

修復:
- 在所有 Split().Select() 後加 .ToList()
- 確保 EF 可以將 Contains 轉換為 SQL IN 子句

影響文件:
- memberController.cs (2 處)
- accountingController.cs (1 處)
- FollowerController.cs (1 處)
- stockController.cs (1 處)

技術說明:
LINQ to Entities 要求 Contains 的集合參數是具體化的集合(List/Array),
而不能是延遲執行的 IEnumerable,以便正確生成 SQL 查詢。
2025-11-12 17:01:49 +08:00
79b7dd114f 修復 Batch 1: FollowerController, memberController, accountingController, stockController
- FollowerController.cs: 8 處修復
- memberController.cs: 9 處修復
- accountingController.cs: 8 處修復
- stockController.cs: 8 處修復

總計 33 處,覆蓋會員、財務、庫存核心功能
2025-11-12 16:37:59 +08:00
af2c152ef6 migrate to new git 2025-08-29 01:27:25 +08:00