如何从文档类型中获取Validation属性?

问题描述 投票:0回答:1

如何从属性设置中获取验证?我创建了一个新的文档类型,我在那里写了正则表达式,我想从UmbracoApiController获取正则表达式我有这个页面的内容

IContent content = Services.ContentService.GetById(pageId);

但我没有找到验证对象:validation regex

编辑

我找到了结果:

var contentType = ApplicationContext.Current.Services.ContentTypeService.GetContentType(contentTypeId);
List<PropertyTypeCollection> propertyGroups = contentType.PropertyGroups.Select(s=>s.PropertyTypes).ToList();

enter image description here

umbraco umbraco7
1个回答
0
投票

据我所知,验证属性仅用于后台,您可能需要在前端或控制器中重新执行: - /

© www.soinside.com 2019 - 2024. All rights reserved.