I'm trying refactoring a code and write it as simple as possible. I want to know if it's possible to use true ? condition 1:condition 2 instead of if in razor? or any better code to make it shorter. this is my code:
<td style="direction: ltr; text-align: center">
if (bankDepositHistoryItem.AccountId != bankDepositHistoryItem.Mail)
{
<div>
@(bankDepositHistoryItem.Mail)
</div>
<font size="1">
<div>
@( "(" + bankDepositHistoryItem.AccountId + ")" )
</div>
</font>
}
else
{
@bankDepositHistoryItem.AccountId
}
Aucun commentaire:
Enregistrer un commentaire