Class WMDataSourceBaseDTO
Data Transfer Object proxy for a WMDataSourceBase.
Inheritance
Implements
Inherited Members
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
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
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 |