

výsledok LINQ dotazu ako ObservableCollection
dá sa nejako zjednodušiť zápis:
attachmentsListBox.ItemsSource = new ObservableCollection<Attachments>();
var attachments =
from attachment in DocumentDB.Attachments
where attachment.DocumentId == Documents.Id
select attachment;
foreach (var attachment in attachments)
((ObservableCollection<Attachments>)attachmentsListBox.ItemsSource).Add(attachment);
aby som tam nemal ten zbytočný cyklus? potreboval by som aby mi linq dotaz vracal namiesto výsledkov typu IEnumerable kolekciu typu ObservableCollection.