誰か次のコードを説明してreturn total ?? decimal.Zero
くれませんか?
public decimal GetTotal()
{
// Part Price * Count of parts sum all totals to get basket total
decimal? total = (from basketItems in db.Baskets
where basketItems.BasketId == ShoppingBasketId
select (int?)basketItems.Qty * basketItems.Part.Price).Sum();
return total ?? decimal.Zero;
}
以下の意味でしょうか?
if (total !=null) return total;
else return 0;