當我使用的LINQ查詢給錯誤
var emp = _testModel.Where(m => m.Date == DateTime.Now).Select(m=>m);
的LINQ表達式的誤差
'System.Collections.Generic.IEnumerable<TestModel>' does not contain a definition for 'System' and no extension method 'System' accepting a first argument of type 'System.Collections.Generic.IEnumerable<TestModel>' could be found (are you missing a using directive or an assembly reference?).
我已經google'd和我到處找也沒辦法,我得到這個錯誤是什麼它在說什麼?它不會拋出異常。我發現這件事的唯一方法就是通過表達。這是進口
命名空間
using System;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
嘗試過這樣的事情,它仍然給出了錯誤回報
string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
var shortDigits = digits.Where((digit, index) => digit.Length < index);
我完全沒有問題,你的字符串數組,很奇怪 – Graviton
你的名字空間/類名是什麼?那裏有衝突嗎? – Tanzelax