blob: 29a995ad0ecd7758a231080c41224e3ccdfd09c7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
using System;
using System.ComponentModel.DataAnnotations;
namespace DevHive.Web.Models.Identity.Validation
{
public class OnlyLetters : ValidationAttribute
{
public override bool IsValid(object value)
{
var stringValue = (string)value;
foreach (char ch in stringValue)
{
if (!Char.IsLetter(ch))
return false;
}
return true;
}
}
}
|