Table of Contents

Interface IDataContext

Namespace
TimeCockpit.Data
Assembly
TimeCockpit.Data.dll

Interface for data context operations.

public interface IDataContext : IDisposable
Inherited Members
IDisposable.Dispose()
Extension Methods

Properties

Environment

Gets the environment.

Environment Environment { get; }

Property Value

Environment

Localizer

Gets the localizer.

NameLocalizer Localizer { get; }

Property Value

NameLocalizer

Model

Gets the model of the context.

Model Model { get; }

Property Value

Model

Methods

DeleteObjectAsync(EntityObject)

Asynchronously deletes an object.

Task DeleteObjectAsync(EntityObject entityObject)

Parameters

entityObject EntityObject

The id and type of the entity to delete.

Returns

Task

Returns the task representing the operation.

ExecuteAction(ModelAction, ExecutionContext)

Execute the given action.

ActionResult ExecuteAction(ModelAction action, ExecutionContext executionContext)

Parameters

action ModelAction

Action to execute.

executionContext ExecutionContext

Execution context/parameters to use.

Returns

ActionResult

Action result.

GetScriptListResultAsync(ScriptListRequest)

Gets the result of a script source list.

Task<EntityObject[]> GetScriptListResultAsync(ScriptListRequest request)

Parameters

request ScriptListRequest

Request: List name, parameters ...

Returns

Task<EntityObject[]>

Returns the task representing the operation and containing the result entity objects.

RefreshEnvironment()

Refreshes the environment.

void RefreshEnvironment()

RefreshModel()

Refreshes the model.

void RefreshModel()

SaveChangesAsync(ChangeTracker)

Saves the changes from the change tracker to the data context.

Task SaveChangesAsync(ChangeTracker changes)

Parameters

changes ChangeTracker

The ChangeTracker holding the changed objects.

Returns

Task

Returns the task representing the operation.

SaveObjectAsync(EntityObject)

Saves an object to the data context.

Task SaveObjectAsync(EntityObject entityObject)

Parameters

entityObject EntityObject

The entity object to save.

Returns

Task

Returns the task representing the operation.

SelectMultipleAsync(QueryRequest[], CancellationToken)

Canonical method for querying a database with multiple queries at the same time.

Task SelectMultipleAsync(QueryRequest[] queries, CancellationToken cancellationToken)

Parameters

queries QueryRequest[]

The query request objects.

cancellationToken CancellationToken

A cancellation token used for all operations.

Returns

Task

Returns a list of tasks representing the query operations.

Remarks

This interface is the lowest level interface and should support all scenarios required. Use the helper methods in to find an easier interface.