Afternoon,
I would like to return a bool if the prices match. I am returning 3 different prices, however i need to compare if lowprice and amzprice are the same. If they are i need to also return…
pricematched = true
Below is my current query.
var query = from a in dc.aProducts
join t in dc.tProducts on a.sku equals t.sku
join lp in dc.LowestPrices on a.asin equals lp.productAsin
orderby t.title
select new GetLowestPrices
{
productAsin = lp.productAsin,
sku = t.sku,
title = t.title,
oprice = Convert.ToString(t.tPrice),
lowprice = Convert.ToString(lp.price),
amzprice = Convert.ToString(lp.tAmzPrice),
lastupdated = Convert.ToDateTime(lp.priceDate)
};
return query.ToList();
all help will be much appreciated, thanks.
If you can add the boolean to your existing object, it just factors into the query like below:
Otherwise you’ll have to do it outside the query with a secondary query: