Show / Hide Table of Contents

Class WMAssetBase

Provides a base class for the Quantellia.WMServer.Asset namespace that implements the common properties used by all other instantiable classes.

Inheritance
object
WMAssetBase
WMDataReader
WMDataWriter
WMDataSourceBase
WMAssetDirectory
WMDocument
WMDocumentIndex
WMLLM
WMModelBase
Implements
IWMAsset
IDbEntity
IWMEntity
IDocumentedEntity
INamedEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Asset.Base
Assembly: WMServer.dll
Syntax
public class WMAssetBase : IWMAsset, IDbEntity, IWMEntity, IDocumentedEntity, INamedEntity, IWMAssetDirectoryMember, IWMPrincipalOwned

Constructors

WMAssetBase()

Parameterless Constructor. Will populate a random GUID as ID

Declaration
public WMAssetBase()

WMAssetBase(string)

Constructor that specifies ID

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

Properties

CreatedBy

ID of user that created this object.

Declaration
public string CreatedBy { get; set; }
Property Value
Type Description
string

CreatedDate

Date on which this object was created.

Declaration
public DateTime CreatedDate { get; set; }
Property Value
Type Description
DateTime

Documentation

Long-form documentation of this object, which may include format encoding (e.g. Markdown, HTML, etc.)

Declaration
public string? Documentation { get; set; }
Property Value
Type Description
string

DocumentationMIMEType

MIME type of the Documentation property.

Declaration
public string? DocumentationMIMEType { get; set; }
Property Value
Type Description
string

FullPathName

Fully qualified name of the Asset.

Declaration
public string FullPathName { get; }
Property Value
Type Description
string

ID

Unique, primary key ID for this object.

Declaration
public string ID { get; set; }
Property Value
Type Description
string

LastUpdatedBy

ID of the user that last updated this object.

Declaration
public string LastUpdatedBy { get; set; }
Property Value
Type Description
string

LastUpdatedDate

Date on which this object was last updated.

Declaration
public DateTime LastUpdatedDate { get; set; }
Property Value
Type Description
DateTime

Name

Human-readable name of the object instance.

Declaration
public string? Name { get; set; }
Property Value
Type Description
string

Owner

Principal that owns this asset

Declaration
[NotMapped]
public WMPrincipal? Owner { get; set; }
Property Value
Type Description
WMPrincipal

OwnerID

ID of the Owner of this asset.

Declaration
public string? OwnerID { get; set; }
Property Value
Type Description
string

OwnerType

ID of the Owner of this asset.

Declaration
public string? OwnerType { get; set; }
Property Value
Type Description
string

ParentDirectory

Reference to the asset's parent in the model.

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

Properties

Custom properties defined by the user

Declaration
public Dictionary<string, string> Properties { get; set; }
Property Value
Type Description
Dictionary<string, string>

Summary

Short summary describing this object.

Declaration
public string? Summary { get; set; }
Property Value
Type Description
string

Methods

CreateFullPathName(WMAssetDirectory, string)

Returns a FullPathName calculated from a Name and parentDir

Declaration
public static string CreateFullPathName(WMAssetDirectory parentDir, string Name)
Parameters
Type Name Description
WMAssetDirectory parentDir
string Name
Returns
Type Description
string

GetFullPath(WMPrincipal, string, string, WMAppDbContext)

Returns a FullPathName calculated from a name and parentID

Declaration
public static Task<string> GetFullPath(WMPrincipal principal, string parentID, string name, WMAppDbContext dbContext)
Parameters
Type Name Description
WMPrincipal principal
string parentID

The ID

string name

The name to use for this asset directory in the FullPathName

WMAppDbContext dbContext
Returns
Type Description
Task<string>

GetSync<T>(string, string)

A synchronous method for getting asset models, only for use in contexts where asynchronous actions are impossible. Note that assets received with this method do not have Owner or ParentDirectory fields populated.

Declaration
public static T GetSync<T>(string assetDir, string userID) where T : WMAssetBase, new()
Parameters
Type Name Description
string assetDir

The ID or FullPathName of the asset.

string userID

The ID of the WMUser trying to access this asset.

Returns
Type Description
T

The requested asset. An exception will be thrown if the asset doesn't exist.

Type Parameters
Name Description
T

The asset type to get (i.e. WMAssetDirectory, or WMDataSourceBase

Get<T>(WMPrincipal, string, WMAppDbContext)

Declaration
public static Task<T> Get<T>(WMPrincipal principal, string assetID, WMAppDbContext context) where T : class
Parameters
Type Name Description
WMPrincipal principal
string assetID
WMAppDbContext context
Returns
Type Description
Task<T>
Type Parameters
Name Description
T

Implements

IWMAsset
IDbEntity
IWMEntity
IDocumentedEntity
INamedEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
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