Click here to Skip to main content
15,917,709 members

Comments by maiconluizanschau (Top 3 by date)

maiconluizanschau 28-Apr-20 15:59pm View    
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));
maiconluizanschau 28-Apr-20 15:48pm View    
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:07pm View    
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