Hi I am getting the following error with my Linq query.
Cannot implicitly convert type 'System.Collections.Generic.List<string>'
to 'System.Collections.Generic.List<CTS.Domain.OCASPhoneCalls>'
I know what it means, but I'm unsure how to fix it. Can someone help me with my query? I'm really new to 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;
}
}
List<string>but you are declaring aList<OCASPhoneCalls>