Hi Bill;
I used the following code to time it out.
public void TimingLambdaExpressionVsCallback() {
_lambdaStopwatch.Start();
var lambdaQuery = _mgr.Employees;
lambdaQuery.ExecuteAsync(e => {
var employees1 = new ObservableCollection<Employee>();
e.Results.ForEach(employees1.Add);
_lambdaStopwatch.Stop();
Output += "_lambdaStopwatch = " + _lambdaStopwatch.ElapsedMilliseconds + Environment.NewLine;
});
_callbackStopwatch.Start();
var callbackQuery = _mgr.Employees.ExecuteAsync();
callbackQuery.Completed += callbackQuery_Completed;
}
void callbackQuery_Completed(object sender, EntityQueriedEventArgs<Employee> e) {
var employees2 = new ObservableCollection<Employee>();
e.Results.ForEach(employees2.Add);
_callbackStopwatch.Stop();
Output += "_callbackStopwatch = " + _callbackStopwatch.ElapsedMilliseconds + Environment.NewLine;
}
_lambdaStopwatch would take between 3ms and 23ms longer than _callbackStopwatch.