var discount = (i == 1) ? definition.SecondPetDiscount ?? definition.AdditionalPetDiscount :
(i == 2) ? definition.ThirdPetDiscount ?? definition.AdditionalPetDiscount :
definition.AdditionalPetDiscount;
谁能给我这个代码片段的解释?我知道三元运算符。但上面不是这样的。
正常的三元运算符如下所示:
PaidDate = ( paidDate == null ? DateTime.Now : paidDate);