how to show deails of many users based on other table
i have user tables and one table is nselected user table .
if i want to find out which one i s selected by me,want to show information on that users.
var shortlistpersons = (from s in db.Shortlist_Table where s.Shortlist_By == id1 select s);
var shortlistcount = shortlistpersons.Count();
IList<users_details> _temp = new List<users_details>();
if (shortlistcount > 0)
{
foreach(var items in shortlistpersons)
{
var userlist1 = (from u in db.User_Detail
join st in db.State_Name on u.State equals st.State_Id
join h in db.Height_Table on u.Height equals h.Height_Id
join cntry in db.Country_Name on u.Country equals cntry.Country_Id
join e in db.Education_Qualification on u.Education_Qualification equals e.Education_Id
join leng in db.Mother_Tongue on u.Mother_Tongue equals leng.Language_id
join rlgn in db.Religions on u.Religion equals rlgn.Religion_Id
join mangl in db.Manglik_Table on u.Manglik equals mangl.Manglik_Id
join cast in db.Castes on u.Caste equals cast.Caste_Id
join incm in db.AnnuaIncome_Table on u.Annual_Income equals incm.Income_Id
where u.User_id==items.Shortlist_id
select new users_details
{
First_Name = u.First_Name,
Last_Name = u.Last_Name,
Annual_IncomeName = incm.Annual_Income,
Caste1 = cast.Caste1,
Religion_Name = rlgn.Religion_Name,
Language = leng.Language,
EducationName = e.Education,
StateName = st.State,
User_id = u.User_id,
CountryName = cntry.Country,
HeightName = h.Height,
DOB = u.DOB,
ManglikName = mangl.Manglik,
Details = u.Details
});
foreach (var item in userlist1)
{
_temp.Add(new users_details
{
First_Name = item.First_Name,
Last_Name = item.Last_Name,
Annual_IncomeName = item.Annual_IncomeName,
Caste1 = item.Caste1,
Religion_Name = item.Religion_Name,
Language = item.Language,
EducationName = item.EducationName,
StateName = item.StateName,
User_id = item.User_id,
CountryName = item.CountryName,
HeightName = item.HeightName,
DOB = item.DOB,
ManglikName = item.ManglikName,
Details = item.Details,
Age = getage(item.DOB.ToString())// (DateTime.Now.Year - Convert.ToDateTime(item.DOB).Year).ToString(),
// Month = item.Month
});
}
}
}
return View(_temp);
its not working