Well, I have to get all the sales items done. Every item is recorded with a CARRINHOID on a sale, on the sales table I have the CARRINHOID. How do I get all these items? I made this code:
public static List<ItemVenda> BuscarItensPorVendaId()
{
//Aqui ele deveria pegar todos os ID das vendas
Venda venda = new Venda();
string vendaId = venda.CarrinhoId;
return ctx.ItensVenda.Include("Peca").
Where(x => x.CarrinhoId == vendaId).ToList();
}
It only returns the item that is in the cart and not the actual sales table! Help me: (