Search Results for

    Show / Hide Table of Contents

    Interface IDataContext

    Interface for data context operations.

    Inherited Members
    System.IDisposable.Dispose()
    Namespace: TimeCockpit.Data
    Assembly: TimeCockpit.Data.dll
    Syntax
    public interface IDataContext : IDisposable

    Properties

    Environment

    Gets the environment.

    Declaration
    Environment Environment { get; }
    Property Value
    Type Description
    Environment

    Localizer

    Gets the localizer.

    Declaration
    NameLocalizer Localizer { get; }
    Property Value
    Type Description
    NameLocalizer

    Model

    Gets the model of the context.

    Declaration
    Model Model { get; }
    Property Value
    Type Description
    Model

    Methods

    DeleteObjectAsync(EntityObject)

    Asynchronously deletes an object.

    Declaration
    Task DeleteObjectAsync(EntityObject entityObject)
    Parameters
    Type Name Description
    EntityObject entityObject

    The id and type of the entity to delete.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Returns the task representing the operation.

    ExecuteAction(ModelAction, ExecutionContext)

    Execute the given action.

    Declaration
    ActionResult ExecuteAction(ModelAction action, ExecutionContext executionContext)
    Parameters
    Type Name Description
    ModelAction action

    Action to execute.

    ExecutionContext executionContext

    Execution context/parameters to use.

    Returns
    Type Description
    ActionResult

    Action result.

    GetScriptListResultAsync(ScriptListRequest)

    Gets the result of a script source list.

    Declaration
    Task<EntityObject[]> GetScriptListResultAsync(ScriptListRequest request)
    Parameters
    Type Name Description
    ScriptListRequest request

    Request: List name, parameters ...

    Returns
    Type Description
    System.Threading.Tasks.Task<EntityObject[]>

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

    RefreshEnvironment()

    Refreshes the environment.

    Declaration
    void RefreshEnvironment()

    RefreshModel()

    Refreshes the model.

    Declaration
    void RefreshModel()

    SaveChangesAsync(ChangeTracker)

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

    Declaration
    Task SaveChangesAsync(ChangeTracker changes)
    Parameters
    Type Name Description
    ChangeTracker changes

    The ChangeTracker holding the changed objects.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Returns the task representing the operation.

    SaveObjectAsync(EntityObject)

    Saves an object to the data context.

    Declaration
    Task SaveObjectAsync(EntityObject entityObject)
    Parameters
    Type Name Description
    EntityObject entityObject

    The entity object to save.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Returns the task representing the operation.

    SelectMultipleAsync(QueryRequest[], CancellationToken)

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

    Declaration
    Task SelectMultipleAsync(QueryRequest[] queries, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    QueryRequest[] queries

    The query request objects.

    System.Threading.CancellationToken cancellationToken

    A cancellation token used for all operations.

    Returns
    Type Description
    System.Threading.Tasks.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.

    Extension Methods

    IDataContextExtensions.SelectAsync(IDataContext, String, IEnumerable<QueryParameter>, SelectCache)
    IDataContextExtensions.Select(IDataContext, String, IEnumerable<QueryParameter>, SelectCache)
    IDataContextExtensions.SelectSingleAsync(IDataContext, String, IEnumerable<QueryParameter>, SelectCache)
    IDataContextExtensions.SelectSingle(IDataContext, String, IEnumerable<QueryParameter>, SelectCache)
    IDataContextExtensions.SelectSingleAsync(IDataContext, IEntityObject, Boolean)
    IDataContextExtensions.SelectSingle(IDataContext, IEntityObject, Boolean)
    IDataContextExtensions.ExecuteActionAsync(IDataContext, ModelAction, IEnumerable<EntityObject>, ModelEntityBase, EntityObject)
    IDataContextExtensions.ExecuteActionAsync(IDataContext, ModelAction, IEnumerable<Guid>, ModelEntityBase, EntityObject)
    IDataContextExtensions.ExecuteAction(IDataContext, ModelAction, IEnumerable<EntityObject>, ModelEntityBase, EntityObject)
    IDataContextExtensions.ExecuteAction(IDataContext, ModelAction, IEnumerable<Guid>, ModelEntityBase, EntityObject)
    IDataContextExtensions.RefreshModelAsync(IDataContext)
    IDataContextExtensions.UserHasAdminRole(IDataContext, Model)
    IDataContextExtensions.SaveObject(IDataContext, EntityObject)
    IDataContextExtensions.DeleteObject(IDataContext, EntityObject)
    In This Article
    Back to top Copyright © 2020 software architects gmbh