How do I do the price conversion within this LINQ select?
Let’s say I want the selected price to be 1.5 times the price I read in from the xml file. Where do I do this multiplication?
select new
{
Price = double.Parse(d.Element(price).Value).ToString(),
ProductName = d.Element(productName).Value
}
I was hoping for something like this, but obviously, that’s an error:
Price = double.Parse(d.Element(price).Value * 1.5).ToString(),
You should do