What type of object should be attached to my WPF form in an n-level application?

I am currently working on a small C # N-Tier application that uses Linq-to-Entities (SQL Express 2005 for DB) and WPF, and I am wondering what type of data collection should use my business logic level user interface .

Are there any drawbacks (performance, validation, etc.) for binding form objects such as datagridviews to IQueryable? Should I populate a DataTable in memory and pass it to the user interface? In which layer should the DataContext be initialized?

+3
source share
2 answers

IQueryable<T> ( ASP.NET, IEnumerable<T> ) - . DataTable . , , List<T>/BindingList<T> ..; .

var qry = ...;
var list = qry.ToList();

list .

IMO, , .

+4

Marc, ObservableCollection<T>.

EDIT: ObservableCollections MVVM, , .

+5

Source: https://habr.com/ru/post/1703799/


All Articles