The LoadOperation worked well for the DataGrid.
However for the List does not work.
The operation [for each] performed before bringing the record.
As I await the end of the operation to run [for each]?
<OK>
private void btnPesquisar_Click(object sender, RoutedEventArgs e)
{
EntityQuery<NFe_C_emit> query =
from c in _customerContext.GetNFe_C_emitQuery()
select c;
LoadOperation<NFe_C_emit> loadOp = this._customerContext.Load(query);
dataGrid1.ItemsSource = loadOp.Entities;
}
<NOT WORK>
private void btnSelecionar_Click(object sender, RoutedEventArgs e)
{
EntityQuery<NFe_C_emit> query =
from c in _customerContext.GetNFe_C_emitQuery()
select c;
LoadOperation<NFe_C_emit> loadOp = this._customerContext.Load(query);
List<NFe_C_emit> list = loadOp.Entities.ToList();
foreach (NFe_C_emit item in list)
{
textBox1.Text = item.xNome;
}
}
However for the List does not work.
The operation [for each] performed before bringing the record.
As I await the end of the operation to run [for each]?
<OK>
private void btnPesquisar_Click(object sender, RoutedEventArgs e)
{
EntityQuery<NFe_C_emit> query =
from c in _customerContext.GetNFe_C_
select c;
LoadOperation<NFe_C_emit> loadOp = this._customerContext.Load
dataGrid1.ItemsSource = loadOp.Entities;
}
<NOT WORK>
private void btnSelecionar_Click(object
{
EntityQuery<NFe_C_emit> query =
from c in _customerContext.GetNFe_C_
select c;
LoadOperation<NFe_C_emit> loadOp = this._customerContext.Load
List<NFe_C_emit> list = loadOp.Entities.ToList();
foreach (NFe_C_emit item in list)
{
textBox1.Text = item.xNome;
}
}