public void metodoX()
{
foreach (TURNO t in listaTurnoPersona)
{
DataServiceQuery<VST_CANTIDAD_PERSONAS_POR_DIA> query =
General.Entities.VST_CANTIDAD_PERSONAS_POR_DIA.Where(
z => z.ID_TURN == t.ID_TURN
&& z.FE_CALE >= RadDatePicker1.SelectedDate.Value
&& z.FE_CALE <= RadDatePicker1.SelectedDate.Value.AddDays(6))
as DataServiceQuery<VST_CANTIDAD_PERSONAS_POR_DIA>;
query.BeginExecute(ProcesarHorarioPersonasTurno, query);
//HERE THE ID_TURN CHANGE 1, 2, 3 , 4 ...
}
}
public void ProcesarHorarioPersonasTurno(IAsyncResult result)
{
List<VST_CANTIDAD_PERSONAS_POR_DIA> listaDias = (result.AsyncState as DataServiceQuery<VST_CANTIDAD_PERSONAS_POR_DIA>).EndExecute(result).ToList();
//HERE ALWAYS I GET THE RESULT IDTURN = 1}
请检查上面的代码,为什么会发生这种情况,假设 ID_TURN 也发生了变化,以前没有发生这种情况。