IOT Dash
Public Member Functions | List of all members
IotDash.Services.IModelStore< TEntity, TKey > Interface Template Reference
Inheritance diagram for IotDash.Services.IModelStore< TEntity, TKey >:
Inheritance graph
[legend]
Collaboration diagram for IotDash.Services.IModelStore< TEntity, TKey >:
Collaboration graph
[legend]

Public Member Functions

Task< IReadOnlyList< TEntity > > GetAllAsync ()
 
Task< TEntity?> GetByKeyAsync (TKey key)
 
Task CreateAsync (TEntity entityToCreate)
 
Task< bool > DeleteByKeyAsync (TKey entityId)
 
- Public Member Functions inherited from IotDash.Services.IModelSaver
Task< bool > SaveChangesAsync ()
 

Detailed Description

Represents a contract for a store object which provides CRUD operations on TEntity indexed by TKey .

Template Parameters
TEntity
TKey
Type Constraints
TEntity :class 

Member Function Documentation

◆ CreateAsync()

Task IotDash.Services.IModelStore< TEntity, TKey >.CreateAsync ( TEntity  entityToCreate)

Create an entity in the database.

Parameters
entityToCreateA new entity to create.
Returns
A task that represents the asynchronous creation action. It resolves when action is completed.

◆ DeleteByKeyAsync()

Task< bool > IotDash.Services.IModelStore< TEntity, TKey >.DeleteByKeyAsync ( TKey  entityId)

Deletes an entity from the databse.

Parameters
entityIdThe identificator of the entity to delete.
Returns
A task that represents the asynchronous save operation. The task result is false, when no entity with such id exists.

◆ GetAllAsync()

Task< IReadOnlyList< TEntity > > IotDash.Services.IModelStore< TEntity, TKey >.GetAllAsync ( )

Retrieve all entities from the database.

Returns
A read-only list of all entities.

◆ GetByKeyAsync()

Task< TEntity?> IotDash.Services.IModelStore< TEntity, TKey >.GetByKeyAsync ( TKey  key)

Get an entity from database by key .

Parameters
key
Returns
An entity with the matching key or null if not found.

The documentation for this interface was generated from the following file: