Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
am trying to return the pets that are linked to a certain client but the message Sql = The function evaluation requires that all threads are executed. But I'm not able to find out why this happens, if someone can help me

  public ActionResult Index()
    {

        if (Session["nomeUsuarioLogado"] != null && Session["usuarioLogadoID"] != null)

        {
            int idcliente = new LoginController().Clientes(this);

            var consultar = from Pets in db.pets
                            join c in db.clientes on Pets.id_pets equals c.id_cliente
                            where c.id_cliente == idcliente
                            select Pets;

            return View(consultar);


            //    return View(db.pets.ToList());
        }
        return RedirectToAction("Index", "login");
    }




}


What I have tried:

am trying to return the pets that are linked to a certain client but the message Sql = The function evaluation requires that all threads are executed. But I'm not able to find out why this happens, if someone can help me
Posted
Updated 28-Apr-20 8:58am

1 solution

That's a message which appears when you are debugging your code and trying to examine the value of a variable, but the debugger has determined that retrieving the value would alter the state of your program.

Why do we get “The function evaluation requires all threads to run” | Microsoft Docs[^]
 
Share this answer
 
Comments
maiconluizanschau 28-Apr-20 15:07pm    
as the documentation activated debug and presents this error SELECT `Extent1`.`id_pets`, `Extent1`.`id_cliente`, `Extent1`.`nome`, `Extent1`.`Sexo`, `Extent1`.`especie`, `Extent1`.`raca`, `Extent1`.`idade`, `Extent1`.`descricao`, `Extent1`.`imagem` FROM `pets` AS `Extent1` INNER JOIN `clientes` AS `Extent2` ON `Extent1`.`id_pets` = `Extent2`.`id_cliente` WHERE `Extent2`.`id_cliente` = @p__linq__0
Richard Deeming 28-Apr-20 15:09pm    
That's not an error; that's the SQL query it's going to execute.
maiconluizanschau 28-Apr-20 15:48pm    
From what I discovered it must be some query error because when the client id and pet id is the same in the pets table it returns the pet linked to the user, however when the pet id is different it doesn't work.
maiconluizanschau 28-Apr-20 15:59pm    
I found out it was just a mistake of mine to query the tables was comparing the values ​​incorrectly.
int idcliente = new LoginController().Clientes(this);
var consultar = from pets in db.pets
join c in db.clientes on pets.id_cliente equals c.id_cliente
where c.id_cliente == idcliente
select pets;
return View(consultar.OrderBy(p => p.nome));

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900