Hello,
Running this query on Northwind ProductId has the value of CategoryId. Based on the results of my business code it looks like it gets the value of the first Id/long in the table, but I also noticed that a boolean got the wrong value and I didn't really understand where the value was getting from.
var products =
(
from p in Product
select new
{
Product = p,
ProductId = p.ProductId, //This one is wrong
}
)
.ToList();
products.Dump();
Renaming the returned field to something else (ProductId => ProductId2) fixes this:
var products =
(
from p in Product
select new
{
Product = p,
ProductId2 = p.ProductId, //Now this is correct
}
)
.ToList();
products.Dump();
Btw for the sake of short code I use anonymous types but in my original code I used normal classes and that also fails.
This happened in the same statement of the other forum thread, but I think it is not related, just my bad luck