79 public IQueryable<Model.Model.Talent> GetTalents()
80 {
81 var tal = from t in _db.Talents
82 join tre in _db.Responses on t.EyeColorID equals tre.ResponseID
83 into tempEyes
84 from rEyes in tempEyes.DefaultIfEmpty()
85 let tLanguage = GetTalentLanguages(t.TalentID)
86 where t.Active == true
87 select new Model.Model.Talent
88 {
89 Id = t.TalentID,
90 FirstName = t.FirstName,
91 LastName = t.LastName,
92 EyeColorID = t.EyeColorID ?? -1,
93 EyeColor = rEyes.ResponseName,
94 TalentLanguages = new LazyList<Model.Model.TalentLanguage>(tLanguage),
95 //LanguagesString = t.TalentLanguages.ToLanguageNameString(_LanguageRepository.GetLanguages()),
96 LanguagesString = String.Join(", "
97 ,(from tl in _db.TalentLanguages
98 join l in _db.Languages on tl.LanguageID equals l.LanguageID
99 where tl.TalentID == t.TalentID
100 select l.LanguageName.ToString()).ToArray())
101 };
102 return tal ;
103 }
No comments:
Post a Comment