KlusterKite  0.0.0
A framework to create scalable and redundant services based on awesome Akka.Net project.
KlusterKite.Data.DataFactory< TContext, TObject, TId > Class Template Referenceabstract

Base factory to work with data objects More...

Inheritance diagram for KlusterKite.Data.DataFactory< TContext, TObject, TId >:
KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId > KlusterKite.Data.EF.EntityDataFactorySync< TContext, TObject, TId >

Public Member Functions

abstract Task< Maybe< TObject > > Delete (TId id)
 Deletes object from data source More...
 
abstract Task< Maybe< TObject > > Get (TId id)
 Gets an object from data source using it's identification More...
 
abstract TId GetId (TObject obj)
 Gets the object's identification from object More...
 
abstract Task< CollectionResponse< TObject > > GetList (Expression< Func< TObject, bool >> filter, List< SortingCondition > sort, int? skip, int? count, ApiRequest apiRequest)
 Gets a list of objects from data source More...
 
abstract Task Insert (TObject obj)
 Adds an object to data source More...
 
abstract Task Update (TObject newData, TObject oldData)
 Updates an object in data source More...
 

Static Public Member Functions

static DataFactory< TContext, TObject, TId > CreateFactory (IComponentContext componentContext, TContext context)
 Gets the new data factory registered in DI More...
 

Protected Member Functions

 DataFactory (TContext context)
 Initializes a new instance of the DataFactory<TContext,TObject,TId> class. More...
 

Properties

TContext Context [get]
 Gets the current data source context More...
 

Detailed Description

Base factory to work with data objects

Template Parameters
TContextThe current data source context
TObjectType of data object to work with
TIdThe type of object identification field
Type Constraints
TObject :class 

Definition at line 31 of file DataFactory.cs.

Constructor & Destructor Documentation

◆ DataFactory()

KlusterKite.Data.DataFactory< TContext, TObject, TId >.DataFactory ( TContext  context)
protected

Initializes a new instance of the DataFactory<TContext,TObject,TId> class.

Parameters
contextThe current data source context.

Definition at line 39 of file DataFactory.cs.

Member Function Documentation

◆ CreateFactory()

static DataFactory<TContext, TObject, TId> KlusterKite.Data.DataFactory< TContext, TObject, TId >.CreateFactory ( IComponentContext  componentContext,
TContext  context 
)
static

Gets the new data factory registered in DI

Parameters
componentContextThe component Context.
contextCurrent data context
Returns
The new data factory

Definition at line 62 of file DataFactory.cs.

◆ Delete()

abstract Task<Maybe<TObject> > KlusterKite.Data.DataFactory< TContext, TObject, TId >.Delete ( TId  id)
pure virtual

Deletes object from data source

Parameters
idObjects identification
Returns
Removed objects data

Implemented in KlusterKite.Data.EF.EntityDataFactorySync< TContext, TObject, TId >, and KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.

◆ Get()

abstract Task<Maybe<TObject> > KlusterKite.Data.DataFactory< TContext, TObject, TId >.Get ( TId  id)
pure virtual

Gets an object from data source using it's identification

Parameters
idThe object's identification
Returns
Async execution task

Implemented in KlusterKite.Data.EF.EntityDataFactorySync< TContext, TObject, TId >, and KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.

◆ GetId()

abstract TId KlusterKite.Data.DataFactory< TContext, TObject, TId >.GetId ( TObject  obj)
pure virtual

Gets the object's identification from object

Parameters
objThe data object
Returns
The object's identification

◆ GetList()

abstract Task<CollectionResponse<TObject> > KlusterKite.Data.DataFactory< TContext, TObject, TId >.GetList ( Expression< Func< TObject, bool >>  filter,
List< SortingCondition sort,
int?  skip,
int?  count,
ApiRequest  apiRequest 
)
pure virtual

Gets a list of objects from data source

Parameters
filterThe filter condition.
sortThe sort condition.
skipThe number of objects to skip from select
countThe maximum number of objects to return. Returns all on null.
apiRequestThe original ApiRequest. Optional.
Returns
The list of objects from data source

Implemented in KlusterKite.Data.EF.EntityDataFactorySync< TContext, TObject, TId >, and KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.

◆ Insert()

abstract Task KlusterKite.Data.DataFactory< TContext, TObject, TId >.Insert ( TObject  obj)
pure virtual

Adds an object to data source

Parameters
objThe object to add
Returns
Async execution task

Implemented in KlusterKite.Data.EF.EntityDataFactorySync< TContext, TObject, TId >, and KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.

◆ Update()

abstract Task KlusterKite.Data.DataFactory< TContext, TObject, TId >.Update ( TObject  newData,
TObject  oldData 
)
pure virtual

Updates an object in data source

Parameters
newDataThe new object's data
oldDataThe old object's data
Returns
Async execution task

Implemented in KlusterKite.Data.EF.EntityDataFactorySync< TContext, TObject, TId >, and KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.

Property Documentation

◆ Context

TContext KlusterKite.Data.DataFactory< TContext, TObject, TId >.Context
getprotected

Gets the current data source context

Definition at line 48 of file DataFactory.cs.


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