{"record":{"id":"d0c526c3cc77a1b1","repo":"abpframework/abp","slug":"parametername-length-must-be-equal-to-or-bigger","errorCode":null,"errorMessage":"{parameterName} length must be equal to or bigger than {minLength}!","messagePattern":"(.+?) length must be equal to or bigger than (.+?)!","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Core/Volo/Abp/Check.cs","lineNumber":57,"sourceCode":"    public static string NotNull(\n        [System.Diagnostics.CodeAnalysis.NotNull] string? value,\n        [InvokerParameterName][NotNull] string parameterName,\n        int maxLength = int.MaxValue,\n        int minLength = 0)\n    {\n        if (value == null)\n        {\n            throw new ArgumentException($\"{parameterName} can not be null!\", parameterName);\n        }\n\n        if (value.Length > maxLength)\n        {\n            throw new ArgumentException($\"{parameterName} length must be equal to or lower than {maxLength}!\", parameterName);\n        }\n\n        if (minLength > 0 && value.Length < minLength)\n        {\n            throw new ArgumentException($\"{parameterName} length must be equal to or bigger than {minLength}!\", parameterName);\n        }\n\n        return value;\n    }\n\n    [ContractAnnotation(\"value:null => halt\")]\n    public static string NotNullOrWhiteSpace(\n        [System.Diagnostics.CodeAnalysis.NotNull] string? value,\n        [InvokerParameterName][NotNull] string parameterName,\n        int maxLength = int.MaxValue,\n        int minLength = 0)\n    {\n        if (value.IsNullOrWhiteSpace())\n        {\n            throw new ArgumentException($\"{parameterName} can not be null, empty or white space!\", parameterName);\n        }\n\n        if (value!.Length > maxLength)","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Core/Volo/Abp/Check.cs#L39-L75","documentation":"The minLength branch of Check.NotNull(string) fires when minLength > 0 and value.Length < minLength. It enforces minimum-length invariants such as password strength, code format, or fixed-width identifiers at the boundary.","triggerScenarios":"Check.NotNull(value, nameof(value), minLength: 8) with a value shorter than 8 characters; an ABP guard with a minimum-length invariant receiving short input.","commonSituations":"Password / token validation below the floor; short codes; user input that must meet a minimum width.","solutions":["Ensure input meets the minimum length before calling.","Lower minLength if the floor is wrong for the real data.","Pad or reject short input at the caller if the value is user-supplied."],"exampleFix":"// before\nCheck.NotNull(code, nameof(code), minLength: 10); // throws if <10\n\n// after\nCheck.NotNull(code.PadRight(10), nameof(code), minLength: 10);","handlingStrategy":"validation","validationCode":"if (value is null || value.Length < minLength)\n    throw new ArgumentOutOfRangeException(nameof(value));\nCheck.NotNull(value, nameof(value), minLength: minLength);","typeGuard":"bool MeetsMin(string s, int min) => s.Length >= min;","tryCatchPattern":null,"preventionTips":["Enforce minimum length at the input boundary (e.g. [MinLength] attribute).","Reject short input early with a clear user-facing message.","Keep minLength consistent with domain rules (password policy, code format)."],"tags":["validation","argument","length-check"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}