class first
{
private int? firstID;
}
class second
{
private int secondID;
private int secondField;
}
public override Expression<Func<first, bool>> FirstFilter()
{
Contex db = new Contex();
List<second> list = (from p in db.second select p).ToList();
return b => list.Select(p => p.secondID).Contains(b.firstID);
}
에 'System.Collections.Generic.IEnumerable
cannot convert from 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.IEnumerable'
을하지만, 나는 그것을 어떻게 고칠 수 있을지 모른다. firstID이기 때문에 당신은 문제가 점점
list.Select(p => p.secondID).Cast<int?>().Contains(b.firstID);
, list.Select(p => p.secondID)
때문에 IEnumerable<int?
수 있지만 :
return b => list.Select(p => p.secondID).Contains(b.firstID ?? 0);
완벽한, 덕분에 아주 많이, 내가 문제입니다 알았지 만 – kosnkov
멋진 친구를 캐스팅하는 방법을 알고 din't, 이런 물건은 스택을 꼭대기한다! – MvcCmsJon