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

Base factory to work with data objects using Entity Framework. The main work with database is working without async/await due to EF performance issues. You can still use EntityDataFactory<TContext,TObject,TId> for true async/await More...

Inheritance diagram for KlusterKite.Data.EF.EntityDataFactorySync< 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 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 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 Task Insert (TObject obj)
 Adds an object to data source More...
 
override 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

 EntityDataFactorySync (TContext context)
 Initializes a new instance of the EntityDataFactorySync<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. The main work with database is working without async/await due to EF performance issues. You can still use EntityDataFactory<TContext,TObject,TId> for true async/await

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 39 of file EntityDataFactorySync.cs.

Constructor & Destructor Documentation

◆ EntityDataFactorySync()

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

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

Parameters
contextThe current data source context

Definition at line 49 of file EntityDataFactorySync.cs.

Member Function Documentation

◆ Delete()

override async Task<Maybe<TObject> > KlusterKite.Data.EF.EntityDataFactorySync< 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 58 of file EntityDataFactorySync.cs.

◆ Get()

override Task<Maybe<TObject> > KlusterKite.Data.EF.EntityDataFactorySync< 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 76 of file EntityDataFactorySync.cs.

◆ GetDbSet()

◆ GetIdValidationExpression()

abstract Expression<Func<TObject, bool> > KlusterKite.Data.EF.EntityDataFactorySync< 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 Task<CollectionResponse<TObject> > KlusterKite.Data.EF.EntityDataFactorySync< 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 90 of file EntityDataFactorySync.cs.

◆ Insert()

override Task KlusterKite.Data.EF.EntityDataFactorySync< 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 134 of file EntityDataFactorySync.cs.

◆ Update()

override Task KlusterKite.Data.EF.EntityDataFactorySync< 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 147 of file EntityDataFactorySync.cs.


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