Cast LINQ result to ObservableCollection
Jon Skeet give a great answer in the question ,but I still cannot make my own.
Still new to classes, so I am still i
Basically, you need to pass IEnumerable
result of the actual query to the database to initialize the ObservableCollection
:
var linqResults = sql.Staff_Time_TBLs
.Where(staff => staff.Staff_No == SelectedEmployee.Key &&
staff.Date_Data == filterFrom &&
staff.Date_Data == filterTo);
var observable = new ObservableCollection(linqResults);