Table of Contents

Class DatabaseScramblingContext

Namespace
The.Components
Assembly
Instagile.dll
public sealed class DatabaseScramblingContext
Inheritance
DatabaseScramblingContext
Inherited Members

Fields

DocumentsEnabled

public readonly bool DocumentsEnabled

Field Value

bool

Scrambler

Provides data scrambling functions

public readonly IScrambler Scrambler

Field Value

IScrambler

Methods

CopyFileAsync(FileProperty, FileProperty, CancellationToken)

Copy the contents of source into target. If the file has already been copied during the current scrambling run, it will be referenced again rather than being duplicated.

public Task CopyFileAsync(FileProperty source, FileProperty target, CancellationToken cancellationToken)

Parameters

source FileProperty

A file attribute in the unscrambled database.

target FileProperty

A file attribute in the scrambled database.

cancellationToken CancellationToken

A cancellation token.

Returns

Task

Remarks

Automatically creates appropriate access rules in the target database.

CopyImageAsync(ImageProperty, ImageProperty, CancellationToken)

Copy the contents of source into target. If the image has already been copied during the current scrambling run, it will be referenced again rather than being duplicated.

public Task CopyImageAsync(ImageProperty source, ImageProperty target, CancellationToken cancellationToken)

Parameters

source ImageProperty

An image attribute in the unscrambled database.

target ImageProperty

An image attribute in the scrambled database.

cancellationToken CancellationToken

A cancellation token.

Returns

Task

Remarks

Automatically creates appropriate access rules in the target database.

GetOrCreatePlaceholderFileAsync(string, string, CancellationToken)

Try to get a placeholder file with the given MIME type

public Task<FileDocument?> GetOrCreatePlaceholderFileAsync(string extension, string mimeType, CancellationToken cancellationToken)

Parameters

extension string
mimeType string
cancellationToken CancellationToken

Returns

Task<FileDocument>

Remarks

May return null if creating documents is not possible.

GetOrCreatePlaceholderImageAsync(string, string, CancellationToken)

Try to get a placeholder image with the given MIME type

public Task<ImageDocument?> GetOrCreatePlaceholderImageAsync(string extension, string mimeType, CancellationToken cancellationToken)

Parameters

extension string
mimeType string
cancellationToken CancellationToken

Returns

Task<ImageDocument>

Remarks

May return null if creating documents is not possible.