У меня есть 2 таблицы, и используйте этот запрос для выбора некоторой записи.Каков тип возврата моего linq?
var temp = db.Letters
.Where(l => !db.SendLetters.Any(s => s.LetterId == l.Id))
.Select(l => new { CreatedDate = l.CreatedDate, priority = l.priority, Subject = l.Subject);
DashboardListView = CollectionViewSource.GetDefaultView(temp.ToList());
У меня есть ListView и связать его с DashboardListView
<ListView ItemsSource="{Binding DashboardListView}" SelectedItem="{Binding SelectedItem}" sort:GridViewSort.AutoSort="True" IsSynchronizedWithCurrentItem="True" >
<ListView.View>
<GridView>
<GridView.Columns >
<GridViewColumn DisplayMemberBinding="{Binding Subject}" Width="170" sort:GridViewSort.PropertyName="Subject" />
<GridViewColumn DisplayMemberBinding="{Binding CreatedDate}" Width="110" sort:GridViewSort.PropertyName="CreatedDate" />
<GridViewColumn DisplayMemberBinding="{Binding priority}" Width="80" sort:GridViewSort.PropertyName="priority" />
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
и связать SelectedItem с SelectedItem собственности. При выборе строки, я хочу получить товар SelectedItem. (Тема, CreatedDate, ..)
SelectedItem as //type
Какой тип возврата моего LINQ?
Наведите указатель мыши на ключевое слово 'var', и это должно вам сказать. Или сделайте 'GetType()'. –
Почему бы вам не отлаживать и не видеть сами? – Vanlalhriata
'IQueryable <{анонимный тип}>' выглядит вероятным, если вы исправите отсутствующую конечную скобку '}'. –