Hello guys I have the following method:
var usuario;
usuario = UniapontaService.GetUsuarioUniapontaPlanejamentoEstrategico(x => x.IdUsuario == VWUsuarioUniaponta.IdUsuario &&
x.PlanejamentoEstrategico.IdPlanejamentoEstrategico == HorarioTrabalhoCorrente.PlanejamentoEstrategico.IdPlanejamentoEstrategico);
TxtTotalHorasMes.Text = usuario.QuantidadeHorasDisponivelMes.ToString();
usuario = null;
When executes this method, and then executes it again it seem that the EF or something is caching the value of the first query: Exemple: go though the method, query for usuario that is 25, in that then i set null (that was a test) later on in the execution even changing that value in database, when it passes in this method again the variable is still 25....and when I save changes in another method it tries to save usuario from another method. This seems wrong because the variable scope is local and not global The Problem is, when the method is over it should not destroy that variable? How I can solve this??