1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-08 06:28:14 -05:00
bitwarden/src/Core/Utilities/EncryptedStringLengthAttribute.cs
2022-08-29 16:06:55 -04:00

17 lines
465 B
C#

using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Utilities;
public class EncryptedStringLengthAttribute : StringLengthAttribute
{
public EncryptedStringLengthAttribute(int maximumLength)
: base(maximumLength)
{ }
public override string FormatErrorMessage(string name)
{
return string.Format("The field {0} exceeds the maximum encrypted value length of {1} characters.",
name, MaximumLength);
}
}