Show / Hide Table of Contents

Class WMAssetDirectory

Class providing directory type behavior to IWMAsset

Inheritance
object
WMAssetBase
WMAssetDirectory
Implements
IWMAsset
IDbEntity
IWMEntity
IDocumentedEntity
INamedEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
IWMVersionableAsset
IWMOwnableResource
IWMResource
Inherited Members
WMAssetBase.ID
WMAssetBase.CreatedBy
WMAssetBase.CreatedDate
WMAssetBase.LastUpdatedBy
WMAssetBase.LastUpdatedDate
WMAssetBase.Name
WMAssetBase.Documentation
WMAssetBase.DocumentationMIMEType
WMAssetBase.Summary
WMAssetBase.ParentDirectory
WMAssetBase.FullPathName
WMAssetBase.Properties
WMAssetBase.Version
WMAssetBase.VersionName
WMAssetBase.Status
WMAssetBase.IsDeleted
WMAssetBase.Owner
WMAssetBase.OwnerID
WMAssetBase.OwnerType
WMAssetBase.CreateFullPathName(WMAssetDirectory, string)
WMAssetBase.GetFullPath(WMPrincipal, WMAssetIdentifier, string, WMAppDbContext)
WMAssetBase.GetIdentifier(bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Asset.Directory
Assembly: WMServer.dll
Syntax
[HasDTO(typeof(WMAssetDirectoryDTO))]
public class WMAssetDirectory : WMAssetBase, IWMAsset, IDbEntity, IWMEntity, IDocumentedEntity, INamedEntity, IWMAssetDirectoryMember, IWMPrincipalOwned, IWMVersionableAsset, IWMOwnableResource, IWMResource

Constructors

WMAssetDirectory()

Parameterless Constructor. Will populate a random GUID as ID

Declaration
public WMAssetDirectory()

WMAssetDirectory(string)

Constructor that specifies ID

Declaration
public WMAssetDirectory(string ID)
Parameters
Type Name Description
string ID

Properties

Members

A list of members directly under this WMAssetDirectory in the asset hierarchy.

Declaration
public IEnumerable<IWMAssetDirectoryMember> Members { get; set; }
Property Value
Type Description
IEnumerable<IWMAssetDirectoryMember>
Remarks

Note that this is not automatically populated in WMAssetDirectoryDTO.UpdateModel(DbContext, object[]?), as that would results in a cascade of expensive database evaluations whenever any WMAssetDirectory is created. Instead it is provisionally populated only when hierarchy members need to be available, up to a depth arguments, for Get(int)

RootDirectory

Provisional Root WMAssetDirectory

Declaration
public static WMAssetDirectory RootDirectory { get; set; }
Property Value
Type Description
WMAssetDirectory

RootID

The ID associated with RootDirectory.

Declaration
public static string RootID { get; }
Property Value
Type Description
string
Remarks

This value is defined in the software and is the same for all instances. Unlike the user-defined directories, the root directory does not have user-defined metadata. Consequently, the root directory is created in memory when the software is running, but there is no persistent record in the database. The in-memory root record always has ID:

c8051982-f490-43b7-92a1-29efe2efd4a6

SeparatorString

The separator used between names in the FullPathName. (i.e. A/B/C/D)

Declaration
public static char SeparatorString { get; }
Property Value
Type Description
char

VersionSeparatorString

The separator used between IDs or FullPathNames and versions in an identifier. (i.e A/B/C/D;1 or A/B/C/D;2)

Declaration
public static char VersionSeparatorString { get; }
Property Value
Type Description
char

Methods

Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Returns a WMAssetDirectory with identifier if exists, otherwise throws an exception.

Declaration
public static Task<WMAssetDirectory> Get(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier

The identifier of the WMAssetDirectory

WMAppDbContext context

The context

Returns
Type Description
Task<WMAssetDirectory>

Get(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext)

Gets a listing of the specified WMAssetDirectory to the recursion depth specified.

Declaration
public static Task<IEnumerable<WMAssetDirectory>> Get(WMPrincipal principal, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext dbContext = null)
Parameters
Type Name Description
WMPrincipal principal

The principal of the Asset Directory being requested.

WMAssetIdentifier identifier

Specification of the directory to retrieve

int recursionDepth

Depth to which the directory subtrees under the specified directory should be traversed.

WMAppDbContext dbContext

Optional reference to a WMAppDbContext instance.

Returns
Type Description
Task<IEnumerable<WMAssetDirectory>>

GetMembers(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext)

Gets a listing of all IWMAssetDirectoryMember to the recursion depth specified.

Declaration
public static Task<IEnumerable<IWMAssetDirectoryMember>> GetMembers(WMPrincipal principal, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext dbContext = null)
Parameters
Type Name Description
WMPrincipal principal

The owner of the Asset Directory being requested.

WMAssetIdentifier identifier

Specification of the directory to retrieve

int recursionDepth

Depth to which the directory subtrees under the specified directory should be traversed. Set to -1 to return the entire tree under this directory.

WMAppDbContext dbContext

Optional reference to a WMAppDbContext instance.

Returns
Type Description
Task<IEnumerable<IWMAssetDirectoryMember>>

All IWMAssetDirectoryMember's matching the query.

GetPopulatedDirectoryTree(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext)

Evaluates the requested asset directory, and populates directory members for it, and for each child directory up to the depth arguments.

Declaration
public static Task<WMAssetDirectory> GetPopulatedDirectoryTree(WMPrincipal principal, WMAssetIdentifier identifier, int depth, WMAppDbContext dbContext)
Parameters
Type Name Description
WMPrincipal principal

The principal of the requested directory

WMAssetIdentifier identifier
int depth
WMAppDbContext dbContext
Returns
Type Description
Task<WMAssetDirectory>

ResourceDefinition()

The resource operation definition for this asset.

Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type Description
WMResourceOperationsDefinition

Implements

IWMAsset
IDbEntity
IWMEntity
IDocumentedEntity
INamedEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
IWMVersionableAsset
IWMOwnableResource
IWMResource
In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE