嗨我收到以下錯誤與我的Linq查詢。Linq將字符串轉換爲列表
Cannot implicitly convert type 'System.Collections.Generic.List<string>'
to 'System.Collections.Generic.List<CTS.Domain.OCASPhoneCalls>'
我知道它是什麼意思,但我不確定如何解決它。有人可以幫我查詢嗎?我對linq真的很陌生。
public List<OCASPhoneCalls> getPhoneLogs2()
{
using (var repo = new OCASPhoneCallsRepository(new UnitOfWorkCTS()))
{
List<OCASPhoneCalls> phone = repo.AllIncluding(p => p.OCASStaff)
.Where(y => y.intNIOSHClaimID == null)
.Select(w => w.vcharDiscussion.Substring(0, 100) + "...")
.ToList();
return phone;
}
}
您選擇'名單'但你宣告'名單' –