2018-08-02 08:57:32 -04:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Utilities;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2018-08-02 08:57:32 -04:00
|
|
|
|
public class EncryptedStringLengthAttribute : StringLengthAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public EncryptedStringLengthAttribute(int maximumLength)
|
|
|
|
|
|
: base(maximumLength)
|
2022-08-29 15:53:48 -04:00
|
|
|
|
{ }
|
|
|
|
|
|
|
2018-08-02 08:57:32 -04:00
|
|
|
|
public override string FormatErrorMessage(string name)
|
2022-08-29 15:53:48 -04:00
|
|
|
|
{
|
2018-08-02 08:57:32 -04:00
|
|
|
|
return string.Format("The field {0} exceeds the maximum encrypted value length of {1} characters.",
|
|
|
|
|
|
name, MaximumLength);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|