Skip to content

Return null instead of empty string when determining classes from enum #23

@RiRiSharp

Description

@RiRiSharp

Case in point:

    internal static string ToDropdownBootstrapClass(this BsDirection direction)
    {
        return direction switch
        {
            BsDirection.Start => "",
            BsDirection.End => "dropdown-menu-end",
            BsDirection.Down or BsDirection.Up => throw new ArgumentOutOfRangeException(
                nameof(direction),
                direction,
                $"Only {nameof(BsDirection.Start)} or {nameof(BsDirection.End)} are valid for dropdown menu alignment"
            ),
            _ => throw new ArgumentOutOfRangeException(nameof(direction), direction, null),
        };
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions