I have the following query:
var ordersPlacedBeforeOneHourList = ordersPlacedBeforeOneHourAgo.Select(order => order.Promo.PercentOff * (double) order.TotalCost).ToList();
Some of my order.Promo.PercentOff are null. How to change the above line so that if order.Promo is null, it behaves as if the values ββare 0 ?
The idea is that if a specific advertising campaign is not applied, I will calculate the promotion cost as 0 * order.TotalCost (which will always be 0) and go to the following values ββto calculate where orders.Promo may not be zero , but by line.
source share