View Source
Class DataTypeService
Represents the DataType Service, which is an easy access to operations involving IDataType
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public class DataTypeService : ScopeRepositoryService, IDataTypeService, IService
Constructors
View Source
DataTypeService(IScopeProvider, ILogger, IEventMessagesFactory, IDataTypeRepository, IDataTypeContainerRepository, IAuditRepository, IEntityRepository, IContentTypeRepository)
Declaration
public DataTypeService(IScopeProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory, IDataTypeRepository dataTypeRepository, IDataTypeContainerRepository dataTypeContainerRepository, IAuditRepository auditRepository, IEntityRepository entityRepository, IContentTypeRepository contentTypeRepository)
Parameters
Methods
View Source
CreateContainer(Int32, String, Int32)
Declaration
public Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
name |
|
System.Int32 |
userId |
|
Returns
View Source
Delete(IDataType, Int32)
Declaration
public void Delete(IDataType dataType, int userId = -1)
Parameters
Type |
Name |
Description |
IDataType |
dataType |
IDataType to delete
|
System.Int32 |
userId |
Optional Id of the user issuing the deletion
|
View Source
DeleteContainer(Int32, Int32)
Declaration
public Attempt<OperationResult> DeleteContainer(int containerId, int userId = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
containerId |
|
System.Int32 |
userId |
|
Returns
View Source
GetAll(Int32[])
Gets all IDataType objects or those with the ids passed in
Declaration
public IEnumerable<IDataType> GetAll(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
Optional array of Ids
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IDataType> |
An enumerable list of IDataType objects
|
View Source
GetByEditorAlias(String)
Declaration
public IEnumerable<IDataType> GetByEditorAlias(string propertyEditorAlias)
Parameters
Type |
Name |
Description |
System.String |
propertyEditorAlias |
Alias of the property editor
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IDataType> |
Collection of IDataType objects with a matching control id
|
View Source
GetContainer(Guid)
Declaration
public EntityContainer GetContainer(Guid containerId)
Parameters
Type |
Name |
Description |
System.Guid |
containerId |
|
Returns
View Source
GetContainer(Int32)
Declaration
public EntityContainer GetContainer(int containerId)
Parameters
Type |
Name |
Description |
System.Int32 |
containerId |
|
Returns
View Source
GetContainers(Int32[])
Declaration
public IEnumerable<EntityContainer> GetContainers(int[] containerIds)
Parameters
Type |
Name |
Description |
System.Int32[] |
containerIds |
|
Returns
View Source
GetContainers(String, Int32)
Declaration
public IEnumerable<EntityContainer> GetContainers(string name, int level)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Int32 |
level |
|
Returns
View Source
GetContainers(IDataType)
Declaration
public IEnumerable<EntityContainer> GetContainers(IDataType dataType)
Parameters
Returns
View Source
GetDataType(Guid)
Declaration
public IDataType GetDataType(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
Unique guid Id of the DataType
|
Returns
View Source
GetDataType(Int32)
Declaration
public IDataType GetDataType(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
Id of the IDataType
|
Returns
View Source
GetDataType(String)
Declaration
public IDataType GetDataType(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
Name of the IDataType
|
Returns
View Source
GetReferences(Int32)
Declaration
public IReadOnlyDictionary<Udi, IEnumerable<string>> GetReferences(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
System.Collections.Generic.IReadOnlyDictionary<Udi, System.Collections.Generic.IEnumerable<System.String>> |
|
View Source
Move(IDataType, Int32)
Declaration
public Attempt<OperationResult<MoveOperationStatusType>> Move(IDataType toMove, int parentId)
Parameters
Type |
Name |
Description |
IDataType |
toMove |
|
System.Int32 |
parentId |
|
Returns
View Source
RenameContainer(Int32, String, Int32)
Declaration
public Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
name |
|
System.Int32 |
userId |
|
Returns
View Source
Save(IEnumerable<IDataType>, Int32)
Declaration
public void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId = -1)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IDataType> |
dataTypeDefinitions |
IDataType to save
|
System.Int32 |
userId |
Id of the user issuing the save
|
View Source
Save(IEnumerable<IDataType>, Int32, Boolean)
Declaration
public void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId, bool raiseEvents)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IDataType> |
dataTypeDefinitions |
IDataType to save
|
System.Int32 |
userId |
Id of the user issuing the save
|
System.Boolean |
raiseEvents |
Boolean indicating whether or not to raise events
|
View Source
Save(IDataType, Int32)
Declaration
public void Save(IDataType dataType, int userId = -1)
Parameters
Type |
Name |
Description |
IDataType |
dataType |
IDataType to save
|
System.Int32 |
userId |
Id of the user issuing the save
|
View Source
SaveContainer(EntityContainer, Int32)
Declaration
public Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = -1)
Parameters
Returns
Events
View Source
Deleted
Declaration
public static event TypedEventHandler<IDataTypeService, DeleteEventArgs<IDataType>> Deleted
Event Type
View Source
DeletedContainer
Declaration
public static event TypedEventHandler<IDataTypeService, DeleteEventArgs<EntityContainer>> DeletedContainer
Event Type
View Source
Deleting
Declaration
public static event TypedEventHandler<IDataTypeService, DeleteEventArgs<IDataType>> Deleting
Event Type
View Source
DeletingContainer
Declaration
public static event TypedEventHandler<IDataTypeService, DeleteEventArgs<EntityContainer>> DeletingContainer
Event Type
View Source
Moved
Declaration
public static event TypedEventHandler<IDataTypeService, MoveEventArgs<IDataType>> Moved
Event Type
View Source
Moving
Declaration
public static event TypedEventHandler<IDataTypeService, MoveEventArgs<IDataType>> Moving
Event Type
View Source
Saved
Declaration
public static event TypedEventHandler<IDataTypeService, SaveEventArgs<IDataType>> Saved
Event Type
View Source
SavedContainer
Declaration
public static event TypedEventHandler<IDataTypeService, SaveEventArgs<EntityContainer>> SavedContainer
Event Type
View Source
Saving
Declaration
public static event TypedEventHandler<IDataTypeService, SaveEventArgs<IDataType>> Saving
Event Type
View Source
SavingContainer
Declaration
public static event TypedEventHandler<IDataTypeService, SaveEventArgs<EntityContainer>> SavingContainer
Event Type