Can anyone help?
I have 2 classes, basically 1 contains members and other sessions.
They are connected together with a common field called "name"
There is 1 member, but there may be MANY Sessions.
So, if I make a standard connection, I return to one member and several sessions. I just want to return the 1st row of sessions.
there is a SessioEndTime field in the session. So I need to order DESC for this to select the first record.
This is my linq, I have too many returns, I think I need a subquery, but I'm a bit confused.
var sessions = from m in this.members join s in this.sessions on m.Name equals s.Name select new { MemberName = m.Name, SessionTime = s.SessioEndTime};
Help us help.
EDIT
To make it clear, imagine that I have 5 members, each participant has NUMERIC sessions. I just want to get my 5 members, but with only one session, this session is the LAST session that can be obtained in SessionEndTime.
I think I made it a little clearer, if I donβt, then please let me know.
source share