0
votes

How can I take from Property settings the validation? I created a new document types and I wrote there regex and I want take the regex from UmbracoApiController I have the content from this page

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

But I don't found the validation object: validation regex

EDIT

I found the result:

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

enter image description here

1

1 Answers

0
votes

The validation property is, to the best of my knowledge, only for use in the backoffice, You would probably have to re-do it in front end or in your controller :-/