2
:는 '나는 다음과 같은 오류 인스턴스 인수를 잡하고 System.Linq.IQueryable <int?>
가에서 변환 할 수 없습니다' 'System.Collections.Generic.IEnumerable
'에서로 변환 할 수 없습니다 System.Collections.Generic. IEnumerable 'to'System.Linq.IQueryable '
글쎄 문제는 변수가 Assay.assayKey 테이블에 null이 될 수 있으므로 int 대신 int로 사용할 수 없습니까? assayKey. 나는 이것에 곤란하다 어떤 사람이 도울 수 있 었는가 ?? 내 컨트롤러 액션 메소드에서
Search Entry
{
int id {get;set;}
int? key {get;set;}
int[] selectedKeys {get;set;}
}
Assay
{
int id {get;set;}
int? AssayKey { get; set; }
}
CollObject
{
Ienumerable<int> keys {get;set;}
}
감사
는 ID의 배열을 검색하려면 다음을 수행 오전 : SearchEntry.selectedKeys = (from assays in db.assay
where CollObject.Keys.Contains(assay.AssayKey)
select assays.id).toArray();
이 잘 나는 해결책을 찾아 냈다. 분석 키가 널 (NULL)의 INT이기 때문에, 난 그냥 문제는 내가 널 (NULL)의 INT에 .contains를 사용하지 수 있었다이
.Contains(assays.AssayKey ??0)
코드를 다시 입력하지 마십시오. 복사/붙여 넣기를하면 모든 사람에게 도움이됩니다. – Marlon