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

The base connection using data actors More...

Inheritance diagram for KlusterKite.Data.CRUD.Connection< TObject, TId >:
KlusterKite.API.Client.INodeConnection< TObject >

Public Member Functions

 Connection (ActorSystem actorSystem, string dataActorPath, TimeSpan? timeout, RequestContext context)
 
async Task< MutationResult< TObject > > Create (TObject newNode)
 
async Task< MutationResult< TObject > > Delete (TId id)
 
async Task< QueryResult< TObject > > Query (Expression< Func< TObject, bool >> filter, IEnumerable< SortingCondition > sort, int? limit, int? offset, ApiRequest apiRequest)
 
async Task< MutationResult< TObject > > Update (TId id, TObject newNode, ApiRequest apiRequest)
 
- Public Member Functions inherited from KlusterKite.API.Client.INodeConnection< TObject >
Task< QueryResult< T > > Query (Expression< Func< T, bool >> filter, IEnumerable< SortingCondition > sort, int? limit, int? offset, ApiRequest apiRequest)
 Query the datasource for nodes More...
 
Task< MutationResult< T > > Create (T newNode)
 Creates a new node More...
 
Task< MutationResult< T > > Update (object id, T newNode, ApiRequest request)
 Updates a node More...
 
Task< MutationResult< T > > Delete (object id)
 Removes a node from the data store More...
 

Static Protected Member Functions

static MutationResult< TObject > CreateResponse (CrudActionResponse< TObject > response)
 Creates mutation response from actor response More...
 

Properties

RequestContext Context [get]
 Gets the request context More...
 
string DataActorPath [get]
 Gets the path to the data actor More...
 
ActorSystem System [get]
 Gets the actor system More...
 
TimeSpan Timeout [get]
 Gets the request timeout More...
 

Detailed Description

The base connection using data actors

Template Parameters
TObjectThe type of entity
TIdThe type of object id

TODO: remove TId type parameter and recover it from type data

Type Constraints
TObject :class 
TObject :IObjectWithId<TId> 
TObject :new() 

Definition at line 37 of file Connection.cs.

Constructor & Destructor Documentation

◆ Connection()

KlusterKite.Data.CRUD.Connection< TObject, TId >.Connection ( ActorSystem  actorSystem,
string  dataActorPath,
TimeSpan?  timeout,
RequestContext  context 
)

Definition at line 41 of file Connection.cs.

Member Function Documentation

◆ Create()

async Task<MutationResult<TObject> > KlusterKite.Data.CRUD.Connection< TObject, TId >.Create ( TObject  newNode)

Definition at line 70 of file Connection.cs.

◆ CreateResponse()

static MutationResult<TObject> KlusterKite.Data.CRUD.Connection< TObject, TId >.CreateResponse ( CrudActionResponse< TObject >  response)
staticprotected

Creates mutation response from actor response

Parameters
responseThe actor response
Returns
The mutation response

Definition at line 179 of file Connection.cs.

◆ Delete()

async Task<MutationResult<TObject> > KlusterKite.Data.CRUD.Connection< TObject, TId >.Delete ( TId  id)

Definition at line 86 of file Connection.cs.

◆ Query()

async Task<QueryResult<TObject> > KlusterKite.Data.CRUD.Connection< TObject, TId >.Query ( Expression< Func< TObject, bool >>  filter,
IEnumerable< SortingCondition sort,
int?  limit,
int?  offset,
ApiRequest  apiRequest 
)

Definition at line 102 of file Connection.cs.

◆ Update()

async Task<MutationResult<TObject> > KlusterKite.Data.CRUD.Connection< TObject, TId >.Update ( TId  id,
TObject  newNode,
ApiRequest  apiRequest 
)

Definition at line 145 of file Connection.cs.

Property Documentation

◆ Context

RequestContext KlusterKite.Data.CRUD.Connection< TObject, TId >.Context
getprotected

Gets the request context

Definition at line 52 of file Connection.cs.

◆ DataActorPath

string KlusterKite.Data.CRUD.Connection< TObject, TId >.DataActorPath
getprotected

Gets the path to the data actor

Definition at line 57 of file Connection.cs.

◆ System

ActorSystem KlusterKite.Data.CRUD.Connection< TObject, TId >.System
getprotected

Gets the actor system

Definition at line 62 of file Connection.cs.

◆ Timeout

TimeSpan KlusterKite.Data.CRUD.Connection< TObject, TId >.Timeout
getprotected

Gets the request timeout

Definition at line 67 of file Connection.cs.


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