答案 0 :(得分:1)
只需定义类似的演示文稿类型。您不必在构造函数中传递对象:
public class LanguageDisplayTextPresentation
{
public int Key { get; set; }
public string Text { get; set; }
public string Language { get; set; }
}
然后
var query = from t in iDictionaryContext.DisplayTexts
from l in iDictionaryContext.Languages
where
t.LanguageID == l.LanguageID
select new LanguageDisplayTextPresentation
{
Key = t.DisplayKey,
Text = t.DisplayText1,
Language = l.LanguageName
};