예제 #1
0
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            string input   = (string)value;
            bool   success = false;

            var stationBLL = new StationBLL();

            if (stationBLL.GetStationFromName(input) != null)
            {
                return(ValidationResult.Success);
            }
            else
            {
                return(new ValidationResult("Stasjonen du har valgt finnes ikke"));
            }
        }