Reputation: 11
I would like to access all Data Types of UMBRACO through C# code including custom created Data Types. I can get all predefined data types from UMBRACO through ApplicationContext.Services.DataTypeService but not custom created data types.
Can anyone help me over here??
Thanks in advance.
Harshil Shukla
Upvotes: 1
Views: 1527
Reputation: 767
You can use
var allDataTypeDefinitions = ApplicationContext.Services.DataTypeService.GetAllDataTypeDefinitions();
This will return you a IEnumerable with all the information of your data types.
More information here. Hope it helps.
Upvotes: 5
Reputation: 626
umbraco.cms.businesslogic.datatype.DataTypeDefinition[] dataTypes
= umbraco.cms.businesslogic.datatype.DataTypeDefinition.GetAll();
Upvotes: 0