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}
Please Check the code above, why is happening this, is supposed that the ID_TURN also change, this doesn't was happening before.