aspnetcore/test/Microsoft.AspNet.Mvc.Core.Test/Utils/ValidationAttributeUtil.cs

16 lines
534 B
C#

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.DataAnnotations;
namespace Microsoft.AspNet.Mvc
{
public static class ValidationAttributeUtil
{
public static string GetMinLengthErrorMessage(int length, string field)
{
var attr = new MinLengthAttribute(length);
return attr.FormatErrorMessage(field);
}
}
}