Class WMModelBaseDTO
Data Transfer Object for WMModels' collectively.
Implements
Inherited Members
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
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
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 |