I have a SQL ,that have to combine two table (DormApplications as d and DormRooms as r) with d.DormRoomId and r.id ,but how to translate it to LINQ and how to get the selected value ?
String username = Utility.Decryption(LoginAccount);
string now = DateTime.Now.ToShortDateString();
string SQL = "select top 1 name ,Sdate,Edate,DormRoomId,r.RoomId as room from DormApplications d, DormRooms r where d.DormRoomId = r.id and d.Poster = '" + username + "' and d.review = 1 and '"+now+ "' > d.Sdate and '" + now + "' < d.Edate order by d.Edate desc;";
how to translate it ? when it translate to LINQ ,how to get name ,Sdate,Edate,DormRoomId,r.RoomId as room ?