I'm trying to join two models and then select values from the joined table. What I've implemented is by far this from my understanding and gathering informations from different solutions in SO. But in x I'm always getting the values from first context context.EventSessionTeamModels but nothing from the second one. But everything from the Select block is needed to be fetched from the second one context.SessionModels. Maybe I've joined them in a wrong way. I need to know what needs to be done. Let me know if any other portion of the code is need other than the below code.
IQueryable<SessionShortModel> shortInfoSession = context.EventSessionTeamModels
.Join(context.SessionModels, x => x.session_id, y => y.session_id, (x, y) => x)
.Where(x => x.event_id == eid && x.bp_id == attendeeId && x.role_code == "ATD")
.Select(x => new SessionShortModel {
StartTime = x.start_date,
EndTime = x.end_date,
Day = DbFunctions.TruncateTime(x.start_date),
Year = x.start_date.Year,
Month = x.start_date.Month,
Name = x.session_name
});