I m writing a Api in .net core To fetch Below record as shown in image
How can i write this query in linq in simple way
My sql query
select SS.VersionId,SS.ContentId,SS.CourseName,SS.DeptName from (SELECT C.ContentTypeId,C.Id,V.VersionId,V.VersionName,C.CourseName,C.DeptName,V.ContentId FROM [dbo].[ContentDetails] C inner join [dbo].[VersionDetails] V on C.Id=V.ContentId WHERE C.FacultyID=1 )SS where SS.VersionId in ( select Max(V.VersionId) FROM [dbo].[ContentDetails] C inner join [dbo].[VersionDetails] V on C.Id=V.ContentId where C.FacultyID=1 group by V.ContentId )