mardi 7 mai 2019

what is the best Clean code in view (razor)

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