여기에 SQL 쿼리가 있습니다. tables, one is Categories and other Sub Categories
,,, 사용하고 싶습니다. inner query(Category table) and that value pass to outer query(Sub categories table)
람다 식으로 엔티티 프레임 워크로 변환하는 방법 ..? DCSystemSubcategories
을 추정람다 구문을 사용하여 SQL 하위 쿼리를 변환하십시오.
select *
from DC_System_SubCategories
where CatID = (select max(CatID)
from DC_System_Categories)
그리고 'CatId'가 고유하지 않고 모든 일치를 원한다면 :'var q = DC_System_SubCategories.Where (x => x.CatID == DC_System_SubCategories .Max (p => p.CatID)); ' – Magnus
더 나은 변환 .... 편집. –
감사합니다. sir .............하지만 카테고리 테이블에서 최대 ID를 얻은 다음 하위 카테고리 테이블에 전달합니다. –