Show / Hide Table of Contents

Class WMModelBaseDTO

Data Transfer Object for WMModels' collectively.

Inheritance
object
DataTransferObject<WMModelBase>
WMAssetBaseDTO<WMModelBase>
WMModelBaseDTO
Implements
IWMAssetBaseDTO
IWMVersionableAsset
IWMOwnableResource
IWMResource
IDbEntity
IWMEntity
IHasEncryptedValues
Inherited Members
WMAssetBaseDTO<WMModelBase>.ID
WMAssetBaseDTO<WMModelBase>.Name
WMAssetBaseDTO<WMModelBase>.OwnerID
WMAssetBaseDTO<WMModelBase>.OwnerType
WMAssetBaseDTO<WMModelBase>.ParentID
WMAssetBaseDTO<WMModelBase>.FullPathName
WMAssetBaseDTO<WMModelBase>.CreatedBy
WMAssetBaseDTO<WMModelBase>.CreatedDate
WMAssetBaseDTO<WMModelBase>.LastUpdatedBy
WMAssetBaseDTO<WMModelBase>.LastUpdatedDate
WMAssetBaseDTO<WMModelBase>.Summary
WMAssetBaseDTO<WMModelBase>.Documentation
WMAssetBaseDTO<WMModelBase>.DocumentationMIMEType
WMAssetBaseDTO<WMModelBase>.Properties
WMAssetBaseDTO<WMModelBase>.Version
WMAssetBaseDTO<WMModelBase>.VersionName
WMAssetBaseDTO<WMModelBase>.Status
WMAssetBaseDTO<WMModelBase>.IsDeleted
WMAssetBaseDTO<WMModelBase>.PropertiesSerialized
WMAssetBaseDTO<WMModelBase>.UpdateDTO<A, B>(WMPrincipal, WMAssetIdentifier, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMModelBase>.CreateDTO<A, B>(WMPrincipal, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMModelBase>.DeleteDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMModelBase>.ValidateDirectory<T_Asset>(WMPrincipal, WMAssetBaseDTO<T_Asset>, WMAssetBaseDTO<T_Asset>, WMAppDbContext)
WMAssetBaseDTO<WMModelBase>.CloneDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, VersionCreateArgs, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMModelBase>.CommitDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMModelBase>.DTOVersions<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMModelBase>.GetDTO<A>(WMPrincipal, WMAssetIdentifier, IQueryable<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMModelBase>.GetDTOFromDirectory<A>(WMPrincipal, WMAssetIdentifier, int, DbSet<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMModelBase>.GetAuthorizedAssetIQueryable<A>(WMPrincipal, IQueryable<A>, WMAppDbContext)
WMAssetBaseDTO<WMModelBase>.GetEveryAuthorizedAssetIQueryable(WMPrincipal, WMAppDbContext)
WMAssetBaseDTO<WMModelBase>.GetIdentifier(bool)
DataTransferObject<WMModelBase>.ModelObject
DataTransferObject<WMModelBase>.SetID(string)
DataTransferObject<WMModelBase>.CreateModel(WMPrincipal, DbContext, object[])
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Asset.MLModel
Assembly: WMServer.dll
Syntax
[PrimaryKey("ID", new string[] { "Version" })]
public class WMModelBaseDTO : WMAssetBaseDTO<WMModelBase>, IWMAssetBaseDTO, IWMVersionableAsset, IWMOwnableResource, IWMResource, IDbEntity, IWMEntity, IHasEncryptedValues

Constructors

WMModelBaseDTO()

Constructor for WMModelBaseDTO

Declaration
public WMModelBaseDTO()

WMModelBaseDTO(string)

Constructor for WMModelBaseDTO specifying ID

Declaration
public WMModelBaseDTO(string id)
Parameters
Type Name Description
string id

Properties

EncryptionPlaceholder

Standard string to replace encrypted values with when not returning plain-text values.

Declaration
[NotMapped]
public string EncryptionPlaceholder { get; set; }
Property Value
Type Description
string

RegisteredType

Determines the type of model that should be implemented

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

SourceFormat

Indicates what format the source string is in.

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

SourceMode

Indicates how to interpret the source string.

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

SourceString

The source string containing a decision tree.

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

Methods

Clone(WMPrincipal, WMAssetIdentifier, VersionCreateArgs?, WMAppDbContext)

Clones the specified asset with an iterated name "AssetName (1), etc... ", iterates the version number.

Declaration
public static Task<WMModelBaseDTO> Clone(WMPrincipal principal, WMAssetIdentifier identifier, VersionCreateArgs? args, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the directory

VersionCreateArgs args

Arguments for creating a version.

WMAppDbContext context

The DbContext

Returns
Type Description
Task<WMModelBaseDTO>
Exceptions
Type Condition
Exception

Commit(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Commits the specified asset as Head.

Declaration
public static Task Commit(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the directory

WMAppDbContext context

The DbContext

Returns
Type Description
Task
Exceptions
Type Condition
Exception

Create(WMPrincipal, WMModelBaseDTO, WMAppDbContext)

Create a new WMModelBaseDTO from the provided data.

Declaration
public static Task<WMModelBase> Create(WMPrincipal principal, WMModelBaseDTO a_dto, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the model

WMModelBaseDTO a_dto

The WMModelBaseDTO to be created.

WMAppDbContext context

The DbContext

Returns
Type Description
Task<WMModelBase>
Exceptions
Type Condition
Exception

Delete(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Delete the WMModelBaseDTO 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

Evaluate(WMPrincipal, ModelEvaluationArgs, WMAppDbContext)

Performs an evaluation on an existing model.

Declaration
public static Task<ElementValue> Evaluate(WMPrincipal principal, ModelEvaluationArgs args, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal
ModelEvaluationArgs args
WMAppDbContext context
Returns
Type Description
Task<ElementValue>

FromModel()

Create this instance by reading properties from a WMModelBase

Declaration
public override void FromModel()
Overrides
DataTransferObject<WMModelBase>.FromModel()

Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMModelBaseDTO, WMModelBaseDTO>>)

Gets the WMModelBaseDTO instance with the specified id. Ensures ownership.

Declaration
public static Task<WMModelBaseDTO> Get(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext? context = null, Expression<Func<WMModelBaseDTO, WMModelBaseDTO>> propertySelector = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier

The identifier of the asset

WMAppDbContext context
Expression<Func<WMModelBaseDTO, WMModelBaseDTO>> 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<WMModelBaseDTO>

GetFromDirectory(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext, Expression<Func<WMModelBaseDTO, WMModelBaseDTO>>)

Gets a listing of the specified WMModelBaseDTO to the recursion depth specified with the ID/Dir of a WMAssetDirectory as input.

Declaration
public static Task<IEnumerable<WMModelBaseDTO>> GetFromDirectory(WMPrincipal principal, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext context = null, Expression<Func<WMModelBaseDTO, WMModelBaseDTO>> propertySelector = null)
Parameters
Type Name Description
WMPrincipal principal

The owner of the models 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<WMModelBaseDTO, WMModelBaseDTO>> 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<WMModelBaseDTO>>

GetSourceString(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Returns the SourceString belonging to the model with this ID/dir, otherwise an exception.

Declaration
public static Task<string> GetSourceString(WMPrincipal principal, WMAssetIdentifier identifier = null, WMAppDbContext context = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier

The identifier of the asset

WMAppDbContext context
Returns
Type Description
Task<string>

ResourceDefinition()

The resource operation definition for this asset.

Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type Description
WMResourceOperationsDefinition

SetSourceString(WMPrincipal, string, WMAssetIdentifier, WMAppDbContext)

Sets the SourceString belonging to the model with this ID/dir, otherwise an exception.

Declaration
public static Task SetSourceString(WMPrincipal principal, string sourceString, WMAssetIdentifier identifier = null, WMAppDbContext context = null)
Parameters
Type Name Description
WMPrincipal principal
string sourceString

The plain-text representation of this model's source string.

WMAssetIdentifier identifier

The identifier of the asset

WMAppDbContext context
Returns
Type Description
Task

Update(WMPrincipal, WMAssetIdentifier, WMModelBaseDTO, WMAppDbContext)

Updates the specified WMModelBaseDTO from the provided data.

Declaration
public static Task Update(WMPrincipal principal, WMAssetIdentifier identifier, WMModelBaseDTO a_dto, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the model

WMAssetIdentifier identifier

The identifier of the asset

WMModelBaseDTO a_dto

The WMModelBaseDTO to be updated.

WMAppDbContext context

The DbContext

Returns
Type Description
Task
Exceptions
Type Condition
Exception

UpdateModel(WMPrincipal, DbContext, object[]?)

Updates and returns the contained WMModelBase.

Declaration
public override Task<WMModelBase> UpdateModel(WMPrincipal principal, DbContext context, object[]? data = null)
Parameters
Type Name Description
WMPrincipal principal
DbContext context
object[] data
Returns
Type Description
Task<WMModelBase>
Overrides
WMAssetBaseDTO<WMModelBase>.UpdateModel(WMPrincipal, DbContext, object[])

Versions(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Gets all versions of the specified asset.

Declaration
public static Task<IEnumerable<VersionArgs>> Versions(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The owner of the directory

WMAssetIdentifier identifier

The identifier of the directory

WMAppDbContext context

The DbContext

Returns
Type Description
Task<IEnumerable<VersionArgs>>
Exceptions
Type Condition
Exception

Implements

IWMAssetBaseDTO
IWMVersionableAsset
IWMOwnableResource
IWMResource
IDbEntity
IWMEntity
IHasEncryptedValues
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