Пример #1
0
        /// <summary>
        /// Checks if municipality code is valid or not.
        /// </summary>
        /// <returns></returns>
        public override void Validate(ModelStateDictionary modelState)
        {
            if (string.IsNullOrEmpty(Model))
            {
                return;
            }
            var dialCode = codeService.GetDialCode(Model);

            if (dialCode == null || !dialCode.Id.IsAssigned())
            {
                modelState.AddModelError(PropertyName, string.Format(CoreMessages.OpenApi.CodeNotFound, Model));
            }
        }