Oddity
Oddity.Builders.SimpleBuilder< TReturn > Class Template Reference

Represents a simple builder used to retrieve data without any filters. More...

Inheritance diagram for Oddity.Builders.SimpleBuilder< TReturn >:
Oddity.Builders.BuilderBase< TReturn >

Public Member Functions

 SimpleBuilder (OddityCore context, CacheService< TReturn > cache, string endpoint, string id)
 Initializes a new instance of the SimpleBuilder<TReturn> class. More...
 
override TReturn Execute ()
 Performs an synchronous request to the API and returns deserialized JSON. More...
 
override bool Execute (TReturn model)
 Performs an synchronous request to the API and fills passed model in parameter with deserialized JSON. More...
 
override async Task< TReturn > ExecuteAsync ()
 Performs an asynchronous request to the API and returns deserialized JSON. More...
 
override async Task< bool > ExecuteAsync (TReturn model)
 Performs an asynchronous request to the API and fills passed model in parameter with deserialized JSON. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Oddity.Builders.BuilderBase< TReturn >
 BuilderBase (OddityCore context)
 
async Task< string > GetResponseFromEndpoint (string link, string postBody=null)
 
string SerializeJson (object model)
 
TReturn DeserializeJson (string content)
 
void DeserializeJson (string content, TReturn model)
 
- Protected Attributes inherited from Oddity.Builders.BuilderBase< TReturn >
readonly OddityCore Context
 

Detailed Description

Represents a simple builder used to retrieve data without any filters.

Template Parameters
TReturnType which will be returned after successful API request.
Type Constraints
TReturn :ModelBase 
TReturn :IIdentifiable 
TReturn :new() 

Constructor & Destructor Documentation

Oddity.Builders.SimpleBuilder< TReturn >.SimpleBuilder ( OddityCore  context,
CacheService< TReturn >  cache,
string  endpoint,
string  id 
)

Initializes a new instance of the SimpleBuilder<TReturn> class.

Parameters
contextThe Oddity context used to interact with API.
cacheCache service used to speed up requests.
endpointThe endpoint used in this instance to retrieve data from API.
idThe ID of the specified object to retrieve from API.

Member Function Documentation

override TReturn Oddity.Builders.SimpleBuilder< TReturn >.Execute ( )
virtual

Performs an synchronous request to the API and returns deserialized JSON.

Implements Oddity.Builders.BuilderBase< TReturn >.

override bool Oddity.Builders.SimpleBuilder< TReturn >.Execute ( TReturn  model)
virtual

Performs an synchronous request to the API and fills passed model in parameter with deserialized JSON.

Implements Oddity.Builders.BuilderBase< TReturn >.

override async Task<TReturn> Oddity.Builders.SimpleBuilder< TReturn >.ExecuteAsync ( )
virtual

Performs an asynchronous request to the API and returns deserialized JSON.

Implements Oddity.Builders.BuilderBase< TReturn >.

override async Task<bool> Oddity.Builders.SimpleBuilder< TReturn >.ExecuteAsync ( TReturn  model)
virtual

Performs an asynchronous request to the API and fills passed model in parameter with deserialized JSON.

Implements Oddity.Builders.BuilderBase< TReturn >.


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