Как сделать выборку отдельных полей в LINQ C#
Начал работать с LINQ, пока не понимаю некоторых очевидностей
DataClasses1DataContext alldata = new DataClasses1DataContext();
vocabularyDataGrid.ItemsSource = from word in alldata.Words
orderby word.word
select (word);
Мне нужно, чтобы в выборку попали только некоторые из полей, в частности word, translation, Types, как это реализовать?
select (word.word, word.translation, word.Types);
не работает
Ответы (1 шт):
Автор решения: Artyom Lazovikov
→ Ссылка
vocabularyDataGrid.ItemsSource = from word in alldata.Words
orderby word.word
select new { word.word, word.translation, word.Types };
