Skip to content

Return with ternary that contains a BinaryExpression ends up aligning everything on the left. #1442

@belav

Description

@belav
public class ClassName
{
    private string GetShopperReference(string customerNumber)
    {
        return
            adyenSettings.UseShipToNumberForVault
            && SiteContext.Current.ShipTo.CustomerSequence.IsNotBlank()
            ? SiteContext.Current.ShipTo.CustomerSequence
            : customerNumber;
    }
}

Should probably be something like

public class ClassName
{
    private string GetShopperReference(string customerNumber)
    {
        return
            adyenSettings.UseShipToNumberForVault
                && SiteContext.Current.ShipTo.CustomerSequence.IsNotBlank()
            ? SiteContext.Current.ShipTo.CustomerSequence
            : customerNumber;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions