Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hey guys,
I'm trying to follow an example, but I think it was written for an older version so I am looking for the umbraco 7 equivalent to this:
List<PropertyType> types = PropertyType.GetAll().ToList();
Umbraco.Core.Models.PropertyType' does not contain a definition for 'GetAll' - this is the current error I am getting.
Hi Ayo,
try this:
List<PropertyType> types = new List<PropertyType>();foreach (var docType in Services.ContentTypeService.GetAllContentTypes()){ foreach (PropertyType prop in Services.ContentTypeService.GetContentType(docType.Id).PropertyTypes) { types.Add(prop); }}
Maybe there is a better solution, but it should works.Sören
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Get all property types - Umbraco 7
Hey guys,
I'm trying to follow an example, but I think it was written for an older version so I am looking for the umbraco 7 equivalent to this:
Umbraco.Core.Models.PropertyType' does not contain a definition for 'GetAll' - this is the current error I am getting.
Hi Ayo,
try this:
Maybe there is a better solution, but it should works.
Sören
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.