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
Localizer
Gets the localizer.
NameLocalizer Localizer { get; }
Property Value
Model
Gets the model of the context.
Model Model { get; }
Property Value
Methods
DeleteObjectAsync(EntityObject)
Asynchronously deletes an object.
Task DeleteObjectAsync(EntityObject entityObject)
Parameters
entityObjectEntityObjectThe 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
actionModelActionAction to execute.
executionContextExecutionContextExecution context/parameters to use.
Returns
- ActionResult
Action result.
GetScriptListResultAsync(ScriptListRequest)
Gets the result of a script source list.
Task<EntityObject[]> GetScriptListResultAsync(ScriptListRequest request)
Parameters
requestScriptListRequestRequest: 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
changesChangeTrackerThe 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
entityObjectEntityObjectThe 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
queriesQueryRequest[]The query request objects.
cancellationTokenCancellationTokenA 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