Exemple #1
0
        /// <summary>
        /// Validates area code.
        /// </summary>
        /// <param name="modelState"></param>
        public override void Validate(ModelStateDictionary modelState)
        {
            if (string.IsNullOrEmpty(Model))
            {
                return;
            }

            var area = codeService.GetAreaByCodeAndType(Model, type);

            if (area == null || area.Code == null)
            {
                modelState.AddModelError(PropertyName, string.Format(CoreMessages.OpenApi.CodeNotFound, Model));
            }
        }