Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

2
Votes

Use Operator enum value ( https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Operator.html ) instead of string for WhereFilter.

It's used in DataManagerRequest (https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManagerRequest.html )




It prevent to used a big switch with static values :


private Operator SfOperatorStringToEnum(string sfOperator)

{

    Operator filter = Operator.None;

    switch (sfOperator)

    {

        case "lessthan":

            filter = Operator.LessThan;

            break;

        case "greaterthan":

            filter = Operator.GreaterThan;

            break;

        case "lessthanorequal":

            filter = Operator.LessThanOrEqual;

            break;

        case "greaterthanorequal":

            filter = Operator.GreaterThanOrEqual;

            break;

        case "startswith":

            filter = Operator.StartsWith;

            break;

        case "endswith":

            filter = Operator.EndsWith;

            break;

        case "contains":

            filter = Operator.Contains;

            break;

        case "equals":

            filter = Operator.Equal;

            break;

        case "notequals":

            filter = Operator.NotEqual;

            break;

        default:

            break;

    }

    return filter;

}