Class WMAssetDirectoryDTO
Data Transfer Object proxy for a WMAssetDirectory.
Inheritance
Inherited Members
Namespace: Quantellia.WMServer.Asset.Directory
Assembly: WMServer.dll
Syntax
[PrimaryKey("ID", new string[] { "Version" })]
public class WMAssetDirectoryDTO : WMAssetBaseDTO<WMAssetDirectory>, IWMAssetBaseDTO, IWMVersionableAsset, IWMOwnableResource, IWMResource, IDbEntity, IWMEntity
Constructors
WMAssetDirectoryDTO()
Constructor for WMAssetDirectoryDTO
Declaration
public WMAssetDirectoryDTO()
WMAssetDirectoryDTO(string)
Constructor for WMAssetDirectoryDTO specifying ID
Declaration
public WMAssetDirectoryDTO(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id |
Properties
RootDirectoryDTO
Provisional Root WMAssetDirectoryDTO
Declaration
public static WMAssetDirectoryDTO RootDirectoryDTO { get; set; }
Property Value
| Type | Description |
|---|---|
| WMAssetDirectoryDTO |
Methods
Create(WMPrincipal, WMAssetDirectoryDTO, WMAppDbContext)
Create a new WMAssetDirectoryDTO from the provided data.
Declaration
public static Task<WMAssetDirectory> Create(WMPrincipal principal, WMAssetDirectoryDTO a_dto, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The owner of the directory |
| WMAssetDirectoryDTO | a_dto | The WMAssetDirectoryDTO to be created. |
| WMAppDbContext | context | The DbContext |
Returns
| Type | Description |
|---|---|
| Task<WMAssetDirectory> |
Exceptions
| Type | Condition |
|---|---|
| Exception |
Delete(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Delete the WMAssetDirectoryDTO with the corresponding ID or FullPathName
Declaration
public static Task Delete(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The owner of the directory |
| WMAssetIdentifier | identifier | The identifier of the asset |
| WMAppDbContext | context | The DbContext |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| Exception |
DeleteDirectoryTree(WMPrincipal, WMAssetDirectoryDTO, WMAppDbContext)
Deletes all assets whose parent was deleted.
Declaration
public static Task DeleteDirectoryTree(WMPrincipal principal, WMAssetDirectoryDTO ad_dto, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The principal of the asset |
| WMAssetDirectoryDTO | ad_dto | The directory to be deleted. |
| WMAppDbContext | context |
Returns
| Type | Description |
|---|---|
| Task |
FromModel()
Create this instance by reading properties from a WMAssetDirectory
Declaration
public override void FromModel()
Overrides
Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext, Expression<Func<WMAssetDirectoryDTO, WMAssetDirectoryDTO>>)
Returns the identified WMAssetDirectoryDTO, throws exception if does not exist.
Declaration
public static Task<WMAssetDirectoryDTO> Get(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context, Expression<Func<WMAssetDirectoryDTO, WMAssetDirectoryDTO>> propertySelector = null)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | |
| WMAssetIdentifier | identifier | The identifier of the asset |
| WMAppDbContext | context | |
| Expression<Func<WMAssetDirectoryDTO, WMAssetDirectoryDTO>> | propertySelector | An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)) |
Returns
| Type | Description |
|---|---|
| Task<WMAssetDirectoryDTO> |
Exceptions
| Type | Condition |
|---|---|
| Exception |
GetFromDirectory(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext, Expression<Func<WMAssetDirectoryDTO, WMAssetDirectoryDTO>>)
Gets a listing of the specified WMAssetDirectoryDTO to the recursion depth specified.
Declaration
public static Task<IEnumerable<WMAssetDirectoryDTO>> GetFromDirectory(WMPrincipal principal, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext context = null, Expression<Func<WMAssetDirectoryDTO, WMAssetDirectoryDTO>> propertySelector = null)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The owner of the Asset Directory being requested. |
| WMAssetIdentifier | identifier | The identifier of the asset |
| int | recursionDepth | Depth to which the directory subtrees under the specified directory should be traversed. |
| WMAppDbContext | context | Optional reference to a WMAppDbContext instance. |
| Expression<Func<WMAssetDirectoryDTO, WMAssetDirectoryDTO>> | propertySelector | An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)) |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<WMAssetDirectoryDTO>> |
ResourceDefinition()
The resource operation definition for this asset.
Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
| Type | Description |
|---|---|
| WMResourceOperationsDefinition |
Update(WMPrincipal, WMAssetIdentifier, WMAssetDirectoryDTO, WMAppDbContext)
Updates the specified WMAssetDirectoryDTO from the provided data.
Declaration
public static Task Update(WMPrincipal principal, WMAssetIdentifier identifier, WMAssetDirectoryDTO a_dto, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The owner of the directory |
| WMAssetIdentifier | identifier | The identifier of the asset |
| WMAssetDirectoryDTO | a_dto | The WMAssetDirectoryDTO to be updated. |
| WMAppDbContext | context | The DbContext |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| Exception |
UpdateDirectoryTreePaths(WMPrincipal, WMAssetDirectoryDTO, WMAppDbContext)
Updates the FullPathName of all assets whose parent directory was moved.
Declaration
public static Task UpdateDirectoryTreePaths(WMPrincipal principal, WMAssetDirectoryDTO a_dto_new, WMAppDbContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | The principal of the asset directory located at |
| WMAssetDirectoryDTO | a_dto_new | The new asset. The old asset will be retrieved from the database with this asset's ID, and directories will be updated depending on the difference in FullPath |
| WMAppDbContext | context |
Returns
| Type | Description |
|---|---|
| Task |
UpdateModel(WMPrincipal, DbContext, object[]?)
Updates and returns the contained WMAssetDirectory.
Declaration
public override Task<WMAssetDirectory> UpdateModel(WMPrincipal principal, DbContext context, object[]? data = null)
Parameters
| Type | Name | Description |
|---|---|---|
| WMPrincipal | principal | |
| DbContext | context | |
| object[] | data |
Returns
| Type | Description |
|---|---|
| Task<WMAssetDirectory> |