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

Base class to provide basic CRUD operation for REST service More...

Inheritance diagram for KlusterKite.Web.Rest.BaseRestController< TObject, TId >:

Public Member Functions

virtual async Task< IActionResult > Create (TObject data)
 Creates the object More...
 
virtual async Task< IActionResult > Delete (TId id)
 Removes object More...
 
virtual async Task< IActionResult > Get (TId id)
 Gets an object by it's id More...
 
virtual async Task< IActionResult > GetList (int count=100, int skip=0)
 Gets the list of all node templates More...
 
virtual async Task< IActionResult > Update (TId id, [FromBody] TObject data)
 Updates the object data More...
 

Protected Member Functions

 BaseRestController (ActorSystem system)
 Initializes a new instance of the BaseRestController<TObject,TId> class. More...
 
abstract string GetDbActorProxyPath ()
 Gets akka actor path for database worker More...
 
virtual async Task< TObject > SendRequest (CrudActionMessage< TObject, TId > request)
 Creates request to actor system and accepts response More...
 

Protected Attributes

virtual bool DataListIsLarge => true
 The list of returned objects is large. More...
 

Properties

static bool DataIsLarge [get]
 Gets a value indicating whether the individual data stored in entity is large enough to be send via parcels. More...
 
abstract Expression< Func< TObject, bool > > DefaultFilter [get]
 Gets the filtering condition More...
 
abstract List< SortingConditionDefaultSort [get]
 Gets the sorting function More...
 
virtual TimeSpan AkkaTimeout [get]
 Gets timeout for actor system requests More...
 
ActorSystem System [get]
 Gets the actor system More...
 

Detailed Description

Base class to provide basic CRUD operation for REST service

Template Parameters
TObjectThe type of ef object
TIdThe type of object identity field
Type Constraints
TObject :class 

Definition at line 46 of file BaseRestController.cs.

Constructor & Destructor Documentation

◆ BaseRestController()

KlusterKite.Web.Rest.BaseRestController< TObject, TId >.BaseRestController ( ActorSystem  system)
protected

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

Parameters
systemThe system.

Definition at line 63 of file BaseRestController.cs.

Member Function Documentation

◆ Create()

virtual async Task<IActionResult> KlusterKite.Web.Rest.BaseRestController< TObject, TId >.Create ( TObject  data)
virtual

Creates the object

Parameters
dataThe object data
Returns
The new object, as it was created in data source

Definition at line 114 of file BaseRestController.cs.

◆ Delete()

virtual async Task<IActionResult> KlusterKite.Web.Rest.BaseRestController< TObject, TId >.Delete ( TId  id)
virtual

Removes object

Parameters
idThe object's unique id
Returns
The removed object

Definition at line 135 of file BaseRestController.cs.

◆ Get()

virtual async Task<IActionResult> KlusterKite.Web.Rest.BaseRestController< TObject, TId >.Get ( TId  id)
virtual

Gets an object by it's id

Parameters
idThe object's unique id
Returns
The object

Definition at line 155 of file BaseRestController.cs.

◆ GetDbActorProxyPath()

abstract string KlusterKite.Web.Rest.BaseRestController< TObject, TId >.GetDbActorProxyPath ( )
protectedpure virtual

Gets akka actor path for database worker

Returns
Akka actor path

◆ GetList()

virtual async Task<IActionResult> KlusterKite.Web.Rest.BaseRestController< TObject, TId >.GetList ( int  count = 100,
int  skip = 0 
)
virtual

Gets the list of all node templates

Parameters
countThe count of elements to return.
skipThe count of elements to skip.
Returns
list of node templates

Definition at line 192 of file BaseRestController.cs.

◆ SendRequest()

virtual async Task<TObject> KlusterKite.Web.Rest.BaseRestController< TObject, TId >.SendRequest ( CrudActionMessage< TObject, TId >  request)
protectedvirtual

Creates request to actor system and accepts response

Parameters
requestThe request to the actor system
Returns
The object

Definition at line 270 of file BaseRestController.cs.

◆ Update()

virtual async Task<IActionResult> KlusterKite.Web.Rest.BaseRestController< TObject, TId >.Update ( TId  id,
[FromBody] TObject  data 
)
virtual

Updates the object data

Parameters
idThe object's unique id
dataThe object data
Returns
The updated object

Definition at line 246 of file BaseRestController.cs.

Member Data Documentation

◆ DataListIsLarge

virtual bool KlusterKite.Web.Rest.BaseRestController< TObject, TId >.DataListIsLarge => true
protected

The list of returned objects is large.

Large data will be sent and received via parcels pipe. This will have impact on performance, but does not have message size limitations. In case of DataIsLarge this property will be ignored

Definition at line 98 of file BaseRestController.cs.

Property Documentation

◆ AkkaTimeout

virtual TimeSpan KlusterKite.Web.Rest.BaseRestController< TObject, TId >.AkkaTimeout
getprotected

Gets timeout for actor system requests

Definition at line 89 of file BaseRestController.cs.

◆ DataIsLarge

bool KlusterKite.Web.Rest.BaseRestController< TObject, TId >.DataIsLarge
staticgetprotected

Gets a value indicating whether the individual data stored in entity is large enough to be send via parcels.

Definition at line 74 of file BaseRestController.cs.

◆ DefaultFilter

abstract Expression<Func<TObject, bool> > KlusterKite.Web.Rest.BaseRestController< TObject, TId >.DefaultFilter
getprotected

Gets the filtering condition

Definition at line 79 of file BaseRestController.cs.

◆ DefaultSort

abstract List<SortingCondition> KlusterKite.Web.Rest.BaseRestController< TObject, TId >.DefaultSort
getprotected

Gets the sorting function

Definition at line 84 of file BaseRestController.cs.

◆ System

ActorSystem KlusterKite.Web.Rest.BaseRestController< TObject, TId >.System
getprotected

Gets the actor system

Definition at line 104 of file BaseRestController.cs.


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