메신저 가진 예외 유형'System.Collections.Generic.List
public IEnumerable<APPLICANT> GetApplicant()
{
IEnumerable<APPLICANT> applicantdata = Cache.Get("applicants") as IEnumerable<APPLICANT>;
IEnumerable<Profile> profiledata = Cache.Get("profiles") as IEnumerable<Profile>;
if (applicantdata == null)
{
var applicantList = (from a in context.Profiles
join app in context.APPLICANTs
on a.PROFILE_ID equals app.Profile_id into joined
from j in joined.DefaultIfEmpty(new APPLICANT())
select new
{
APPLICANT = j,
Profile = a,
}).Take(1000).AsEnumerable();
applicantdata = applicantList.ToList();
if (applicantdata.Any())
{
Cache.Set("applicants", applicantdata, 30);
}
}
return applicantdata;
}
이 내가 예외 얻을 라인 :
이
내 컨트롤러applicantdata = applicantList.ToList();
을 그리고 이것은
암시 적으로 변환 할 수 없습니다 유형 '은 System.Collections 예외입니다 총. '시스템. 콜렉션. 일반.리스트.'. 명시 적 변환이 존재한다 (당신은 캐스트를 누락?)
오히려 예외보다는 나에게 컴파일 타임 오류처럼 들리지만, 어쨌든
감사합니다. . 난 그냥이 하나처럼되고 싶어요 ... http://stackoverflow.com/questions/4497086/linq-left-join-and-right-join –
@EnriqueGil : 아니, 그렇지 않아 - 왜냐하면 그것은 익명 유형. 당신은'IEnumerable'타입의 변수에 값을 할당하려합니다. 그래서 익명의 타입을 사용할 수 없습니다. –
'select j'를 만든 후 의 깜박임'NotSupportedException이 사용자 코드에 의해 처리되지 않았습니다 'Model.APPLICANT'라는 엔터티 또는 복합 유형을 LINQ to Entities 쿼리에서 생성 할 수 없습니다. ' –