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

Base factory to work with data objects using Entity Framework More...

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

Public Member Functions

override async Task< Maybe< TObject > > Delete (TId id)
 Deletes object from data source More...
 
override async Task< Maybe< TObject > > Get (TId id)
 Gets an object from data source using it's identification More...
 
abstract Expression< Func< TObject, bool > > GetIdValidationExpression (TId id)
 Gets the expression to check an object's identification More...
 
override async 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...
 
override async Task Insert (TObject obj)
 Adds an object to data source More...
 
override async Task Update (TObject newData, TObject oldData)
 Updates an object in data source More...
 
- Public Member Functions inherited from KlusterKite.Data.DataFactory< TContext, TObject, TId >
abstract TId GetId (TObject obj)
 Gets the object's identification from object More...
 

Protected Member Functions

 EntityDataFactory (TContext context)
 Initializes a new instance of the EntityDataFactory<TContext,TObject,TId> class. More...
 
abstract DbSet< TObject > GetDbSet ()
 Gets the data set from current context More...
 
- Protected Member Functions inherited from KlusterKite.Data.DataFactory< TContext, TObject, TId >
 DataFactory (TContext context)
 Initializes a new instance of the DataFactory<TContext,TObject,TId> class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from KlusterKite.Data.DataFactory< TContext, TObject, TId >
static DataFactory< TContext, TObject, TId > CreateFactory (IComponentContext componentContext, TContext context)
 Gets the new data factory registered in DI More...
 
- Properties inherited from KlusterKite.Data.DataFactory< TContext, TObject, TId >
TContext Context [get]
 Gets the current data source context More...
 

Detailed Description

Base factory to work with data objects using Entity Framework

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

Definition at line 34 of file EntityDataFactory.cs.

Constructor & Destructor Documentation

◆ EntityDataFactory()

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

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

Parameters
contextThe current data source context

Definition at line 44 of file EntityDataFactory.cs.

Member Function Documentation

◆ Delete()

override async Task<Maybe<TObject> > KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.Delete ( TId  id)
virtual

Deletes object from data source

Parameters
idObjects identification
Returns
Removed objects data

Implements KlusterKite.Data.DataFactory< TContext, TObject, TId >.

Definition at line 53 of file EntityDataFactory.cs.

◆ Get()

override async Task<Maybe<TObject> > KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.Get ( TId  id)
virtual

Gets an object from data source using it's identification

Parameters
idThe object's identification
Returns
Async execution task

Implements KlusterKite.Data.DataFactory< TContext, TObject, TId >.

Definition at line 71 of file EntityDataFactory.cs.

◆ GetDbSet()

abstract DbSet<TObject> KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.GetDbSet ( )
protectedpure virtual

◆ GetIdValidationExpression()

abstract Expression<Func<TObject, bool> > KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.GetIdValidationExpression ( TId  id)
pure virtual

Gets the expression to check an object's identification

Parameters
idThe identification to check
Returns
The expression

◆ GetList()

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

Gets a list of objects from data source

Implements KlusterKite.Data.DataFactory< TContext, TObject, TId >.

Definition at line 85 of file EntityDataFactory.cs.

◆ Insert()

override async Task KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.Insert ( TObject  obj)
virtual

Adds an object to data source

Parameters
objThe object to add
Returns
Async execution task

Implements KlusterKite.Data.DataFactory< TContext, TObject, TId >.

Definition at line 129 of file EntityDataFactory.cs.

◆ Update()

override async Task KlusterKite.Data.EF.EntityDataFactory< TContext, TObject, TId >.Update ( TObject  newData,
TObject  oldData 
)
virtual

Updates an object in data source

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

Implements KlusterKite.Data.DataFactory< TContext, TObject, TId >.

Definition at line 141 of file EntityDataFactory.cs.


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