时间:2011-01-06 19:14:11

标签: data-binding datagridview linq-to-entities denormalization

1 个答案:

答案 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
    };