0

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.

Ayo Adesina
  • 2,231
  • 3
  • 37
  • 71

1 Answers1

1

You can use new services. For working with DataTypes - DataTypeService

            var ds = ApplicationContext.Current.Services.DataTypeService;
            var dataTypes = ds.GetAllDataTypes();