Show / Hide Table of Contents

Class WMDataSourceBaseDTO

Data Transfer Object proxy for a WMDataSourceBase.

Inheritance
object
DataTransferObject<WMDataSourceBase>
WMAssetBaseDTO<WMDataSourceBase>
WMDataSourceBaseDTO
Implements
IWMAssetBaseDTO
IWMVersionableAsset
IWMOwnableResource
IWMResource
IDbEntity
IWMEntity
IHasEncryptedValues
Inherited Members
WMAssetBaseDTO<WMDataSourceBase>.ID
WMAssetBaseDTO<WMDataSourceBase>.Name
WMAssetBaseDTO<WMDataSourceBase>.OwnerID
WMAssetBaseDTO<WMDataSourceBase>.OwnerType
WMAssetBaseDTO<WMDataSourceBase>.ParentID
WMAssetBaseDTO<WMDataSourceBase>.FullPathName
WMAssetBaseDTO<WMDataSourceBase>.CreatedBy
WMAssetBaseDTO<WMDataSourceBase>.CreatedDate
WMAssetBaseDTO<WMDataSourceBase>.LastUpdatedBy
WMAssetBaseDTO<WMDataSourceBase>.LastUpdatedDate
WMAssetBaseDTO<WMDataSourceBase>.Summary
WMAssetBaseDTO<WMDataSourceBase>.Documentation
WMAssetBaseDTO<WMDataSourceBase>.DocumentationMIMEType
WMAssetBaseDTO<WMDataSourceBase>.Properties
WMAssetBaseDTO<WMDataSourceBase>.Version
WMAssetBaseDTO<WMDataSourceBase>.VersionName
WMAssetBaseDTO<WMDataSourceBase>.Status
WMAssetBaseDTO<WMDataSourceBase>.IsDeleted
WMAssetBaseDTO<WMDataSourceBase>.PropertiesSerialized
WMAssetBaseDTO<WMDataSourceBase>.UpdateDTO<A, B>(WMPrincipal, WMAssetIdentifier, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDataSourceBase>.CreateDTO<A, B>(WMPrincipal, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDataSourceBase>.DeleteDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDataSourceBase>.ValidateDirectory<T_Asset>(WMPrincipal, WMAssetBaseDTO<T_Asset>, WMAssetBaseDTO<T_Asset>, WMAppDbContext)
WMAssetBaseDTO<WMDataSourceBase>.CloneDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, VersionCreateArgs, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMDataSourceBase>.CommitDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMDataSourceBase>.DTOVersions<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMDataSourceBase>.GetDTO<A>(WMPrincipal, WMAssetIdentifier, IQueryable<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMDataSourceBase>.GetDTOFromDirectory<A>(WMPrincipal, WMAssetIdentifier, int, DbSet<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMDataSourceBase>.GetAuthorizedAssetIQueryable<A>(WMPrincipal, IQueryable<A>, WMAppDbContext)
WMAssetBaseDTO<WMDataSourceBase>.GetEveryAuthorizedAssetIQueryable(WMPrincipal, WMAppDbContext)
WMAssetBaseDTO<WMDataSourceBase>.GetIdentifier(bool)
DataTransferObject<WMDataSourceBase>.ModelObject
DataTransferObject<WMDataSourceBase>.SetID(string)
DataTransferObject<WMDataSourceBase>.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.DataSource
Assembly: WMServer.dll
Syntax
[PrimaryKey("ID", new string[] { "Version" })]
public class WMDataSourceBaseDTO : WMAssetBaseDTO<WMDataSourceBase>, IWMAssetBaseDTO, IWMVersionableAsset, IWMOwnableResource, IWMResource, IDbEntity, IWMEntity, IHasEncryptedValues

Constructors

WMDataSourceBaseDTO()

Constructor for WMDataSourceBaseDTO

Declaration
public WMDataSourceBaseDTO()

WMDataSourceBaseDTO(string)

Constructor for WMDataSourceBaseDTO, with specified ID

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

Properties

ConnectionString

The connection string to the database.

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

RegisteredType

The string used to register this data source type in RegisterWMDataSourceType(string, Type)

Declaration
public string RegisteredType { 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<WMDataSourceBaseDTO> 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<WMDataSourceBaseDTO>
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

CommitTransaction(WMPrincipal, string, WMAppDbContext?)

Commits a transaction

Declaration
public static Task CommitTransaction(WMPrincipal principal, string transactionID, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
string transactionID
WMAppDbContext context
Returns
Type Description
Task

Create(WMPrincipal, WMDataSourceBaseDTO, WMAppDbContext)

Create a new WMDataSourceBaseDTO from the provided data.

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

The owner of the data source

WMDataSourceBaseDTO a_dto

The WMDataSourceBaseDTO to be created.

WMAppDbContext context

The DbContext

Returns
Type Description
Task<WMDataSourceBase>
Exceptions
Type Condition
Exception

Delete(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Create a new WMDataSourceBaseDTO from the provided data.

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 corresponding WMDataSourceBaseDTO to be deleted.

WMAppDbContext context

The DbContext

Returns
Type Description
Task
Exceptions
Type Condition
Exception

DeleteData(WMPrincipal, WMAssetIdentifier, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

Updates data in the data source.

Declaration
public static Task<ElementValue> DeleteData(WMPrincipal principal, WMAssetIdentifier identifier, List<InsertUpdateDeleteArgs> args, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier
List<InsertUpdateDeleteArgs> args
WMAppDbContext context
Returns
Type Description
Task<ElementValue>

Evaluate(WMPrincipal, WMAssetIdentifier, DataSourceArgs, WMAppDbContext, string?)

Performs an evaluation on a temporary dataReader one created from the arguments of the body DataSourceArgs, and a supplied data source ID.

Declaration
public static Task<ElementValue> Evaluate(WMPrincipal principal, WMAssetIdentifier identifier, DataSourceArgs args, WMAppDbContext context, string? transactionID = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier

The identifier of the data source to use.

DataSourceArgs args

Arguments for the evaluation

WMAppDbContext context
string transactionID
Returns
Type Description
Task<ElementValue>

FromModel()

Create this instance by reading properties from a WMDataReader

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

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

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

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

identifier of the data source

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

GetAccessorString(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Returns the AccessorString belonging to the data source with this ID/dir, otherwise an exception.

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

The identifier of the data source to get.

WMAppDbContext context
Returns
Type Description
Task<string>

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

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

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

The owner of the data sources being requested.

WMAssetIdentifier identifier

Specification of the directory under which to retrieve WMDataSourceBaseDTO

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<WMDataSourceBaseDTO, WMDataSourceBaseDTO>> 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<WMDataSourceBaseDTO>>

InsertData(WMPrincipal, WMAssetIdentifier, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

Inserts data into the data source.

Declaration
public static Task<ElementValue> InsertData(WMPrincipal principal, WMAssetIdentifier identifier, List<InsertUpdateDeleteArgs> args, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier
List<InsertUpdateDeleteArgs> args
WMAppDbContext context
Returns
Type Description
Task<ElementValue>

OpenTransaction(WMPrincipal, WMAssetIdentifier, WMAppDbContext?)

Opens a transaction on the data source.

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

ResourceDefinition()

The resource operation definition for this asset.

Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type Description
WMResourceOperationsDefinition

RollbackTransaction(WMPrincipal, string, WMAppDbContext?)

Rolls back a transaction

Declaration
public static Task RollbackTransaction(WMPrincipal principal, string transactionID, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
string transactionID
WMAppDbContext context
Returns
Type Description
Task

SetAccessorString(WMPrincipal, string, WMAssetIdentifier, WMAppDbContext)

Sets the AccessorString belonging to the data source with this ID/dir, otherwise an exception.

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

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

WMAssetIdentifier identifier

The identifier of the data source to get.

WMAppDbContext context
Returns
Type Description
Task

Update(WMPrincipal, WMAssetIdentifier, WMDataSourceBaseDTO, WMAppDbContext)

Updates the specified WMDataSourceBaseDTO from the provided data.

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

The owner of the directory

WMAssetIdentifier identifier

The identifierF of the directory

WMDataSourceBaseDTO a_dto

The WMDataSourceBaseDTO to be updated.

WMAppDbContext context

The DbContext

Returns
Type Description
Task
Exceptions
Type Condition
Exception

UpdateData(WMPrincipal, WMAssetIdentifier, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

Updates data in the data source.

Declaration
public static Task<ElementValue> UpdateData(WMPrincipal principal, WMAssetIdentifier identifier, List<InsertUpdateDeleteArgs> args, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier
List<InsertUpdateDeleteArgs> args
WMAppDbContext context
Returns
Type Description
Task<ElementValue>

UpdateModel(WMPrincipal, DbContext, object[]?)

Updates and returns the contained WMDataReader.

Declaration
public override Task<WMDataSourceBase> UpdateModel(WMPrincipal principal, DbContext context, object[]? data = null)
Parameters
Type Name Description
WMPrincipal principal
DbContext context
object[] data
Returns
Type Description
Task<WMDataSourceBase>
Overrides
WMAssetBaseDTO<WMDataSourceBase>.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