Hi,@vitaminchik. Welcome Microsoft Q&A.
It seems that the issue might be with the splitOn parameter. In the Query method, where you use three tables (Orders, Customers, and Products), you could specify the columns on which to split the result set. The splitOn parameter tells Dapper which columns to split on.
You could try changing the splitOn parameter to "CustomerId,ProductId,FirstName,StockQuantity" to include the ProductId column to see if that helps.
var orders = con.Query<Order, Customer, Product, Order>(query, (order, customer, product) =>
{
order.Customer = customer;
order.Product = product;
return order;
}, splitOn: "CustomerId,ProdactId,FirstName,StockQuantity").ToList();
return orders;
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.