{"record":{"id":"780ad6d7c0433fe4","repo":"MudBlazor/MudBlazor","slug":"unknown-operator-name","errorCode":null,"errorMessage":"Unknown operator name.","messagePattern":"Unknown operator name\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/MudBlazor/Components/DataGrid/FilterOperator.cs","lineNumber":384,"sourceCode":"            Number.GreaterThanOrEqual => LanguageResource.MudDataGrid_GreaterThanOrEqualSign,\n            Number.LessThan => LanguageResource.MudDataGrid_LessThanSign,\n            Number.LessThanOrEqual => LanguageResource.MudDataGrid_LessThanOrEqualSign,\n            //Number.Empty => LanguageResource.MudDataGrid_IsEmpty,\n            //Number.NotEmpty => LanguageResource.MudDataGrid_IsNotEmpty,\n            Enum.Is => LanguageResource.MudDataGrid_Is,\n            Enum.IsNot => LanguageResource.MudDataGrid_IsNot,\n            //Boolean.Is => LanguageResource.MudDataGrid_Is,\n            //DateTime.Is => LanguageResource.MudDataGrid_Is,\n            //DateTime.IsNot => LanguageResource.MudDataGrid_IsNot,\n            DateTime.After => LanguageResource.MudDataGrid_IsAfter,\n            DateTime.OnOrAfter => LanguageResource.MudDataGrid_IsOnOrAfter,\n            DateTime.Before => LanguageResource.MudDataGrid_IsBefore,\n            DateTime.OnOrBefore => LanguageResource.MudDataGrid_IsOnOrBefore,\n            //DateTime.Empty => LanguageResource.MudDataGrid_IsEmpty,\n            //DateTime.NotEmpty => LanguageResource.MudDataGrid_IsNotEmpty,\n            //Guid.Equal => LanguageResource.MudDataGrid_Equals,\n            //Guid.NotEqual => LanguageResource.MudDataGrid_NotEquals,\n            _ => throw new ArgumentOutOfRangeException(nameof(operatorName), operatorName, \"Unknown operator name.\")\n        };\n    }\n}\n","sourceCodeStart":366,"sourceCodeEnd":388,"githubUrl":"https://github.com/MudBlazor/MudBlazor/blob/bdb3acd5ddc0a563428488e7afef0d99549f7a6c/src/MudBlazor/Components/DataGrid/FilterOperator.cs#L366-L388","documentation":"FilterOperator.GetOperatorName maps each filter-operator enum value to a localized display string via a switch. Several arms are commented out (Boolean.Is, DateTime.Is/IsNot/Empty/NotEmpty, Guid.Equal/NotEqual), so passing any of those operator values reaches the default arm and throws ArgumentOutOfRangeException. It also fires for any out-of-range operator value.","triggerScenarios":"Requesting the display name for an operator whose localization arm is commented out (e.g. FilterOperator.DateTime.Empty, FilterOperator.Guid.Equal); passing an undefined operator enum integer; the filter UI trying to render a label for a disabled operator.","commonSituations":"Custom filter templates that surface every operator including the disabled ones; upgrading MudBlazor where an operator was deprecated; constructing a FilterDefinition with an operator not yet localized.","solutions":["Only surface operators that FilterOperator.GetOperatorByDataType returns for the column's data type.","Avoid requesting GetOperatorName for commented-out operator values.","If you must reference Guid/Boolean/DateTime equality, use the operators that remain active (e.g. Guid.Equal may be unsupported — use a supported alternative or filter manually)."],"exampleFix":"// before\nvar name = FilterOperator.GetOperatorName(FilterOperator.DateTime.Empty);\n\n// after\n// use a supported DateTime operator, e.g.:\nvar name = FilterOperator.GetOperatorName(FilterOperator.DateTime.Before);","handlingStrategy":"try-catch","validationCode":"var allowed = FilterOperator.GetOperatorByDataType(propertyType);\nif (!allowed.Contains(op))\n{\n    // skip or pick a supported operator\n}","typeGuard":"static bool IsOperatorSupported(FilterOperator op, Type type)\n    => FilterOperator.GetOperatorByDataType(type).Contains(op);","tryCatchPattern":"try { name = FilterOperator.GetOperatorName(op); }\ncatch (ArgumentOutOfRangeException) { /* operator not localized; skip it */ }","preventionTips":["Only request display names for operators returned by GetOperatorByDataType.","Avoid surfacing commented-out operators in custom filter UI.","Handle the upgrade case where operator enums were deprecated."],"tags":["datagrid","filter-operator","localization","argument-out-of-range"],"backgroundTag":null,"analyzedSha":"bdb3acd5ddc0a563428488e7afef0d99549f7a6c","analyzedAt":"2026-08-13T19:36:54.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}