Summary
Set of extension methods associated with JSON serialization.
- Namespace
- Akavache
- Base Types
-
- object
graph BT
Type-->Base0["object"]
Type["JsonSerializationMixin"]
class Type type-node
Syntax
public static class JsonSerializationMixin
Methods
Name | Value | Summary |
---|---|---|
GetAllObjects |
IObservable |
Return all objects of a specific Type in the cache.
static
|
GetAndFetchLatest |
IObservable |
This method attempts to returned a cached value, while
simultaneously calling a Func to return the latest value. When the
latest data comes back, it replaces what was previously in the
cache.
This method is best suited for loading dynamic data from the
Internet, while still showing the user earlier data.
This method returns an IObservable that may return *two* results
(first the cached data, then the latest data). Therefore, it's
important for UI applications that in your Subscribe method, you
write the code to merge the second result when it comes in.
This also means that await'ing this method is a Bad Idea(tm), always
use Subscribe.
static
|
GetAndFetchLatest |
IObservable |
This method attempts to returned a cached value, while
simultaneously calling a Func to return the latest value. When the
latest data comes back, it replaces what was previously in the
cache.
This method is best suited for loading dynamic data from the
Internet, while still showing the user earlier data.
This method returns an IObservable that may return *two* results
(first the cached data, then the latest data). Therefore, it's
important for UI applications that in your Subscribe method, you
write the code to merge the second result when it comes in.
This also means that awaiting this method is a Bad Idea(tm), always
use Subscribe.
static
|
GetObject |
IObservable |
Get an object from the cache and deserialize it via the JSON
serializer.
static
|
GetObjectCreatedAt |
IObservable |
Returns the time that the key was added to the cache, or returns
null if the key isn't in the cache.
static
|
GetOrCreateObject |
IObservable |
Attempt to return an object from the cache. If the item doesn't
exist or returns an error, call a Func to create a new one.
For most Internet applications, this method is the best method to
call to fetch static data (i.e. images) from the network.
static
|
GetOrFetchObject |
IObservable |
Attempt to return an object from the cache. If the item doesn't
exist or returns an error, call a Func to return the latest
version of an object and insert the result in the cache.
For most Internet applications, this method is the best method to
call to fetch static data (i.e. images) from the network.
static
|
GetOrFetchObject |
IObservable |
Attempt to return an object from the cache. If the item doesn't
exist or returns an error, call a Func to return the latest
version of an object and insert the result in the cache.
For most Internet applications, this method is the best method to
call to fetch static data (i.e. images) from the network.
static
|
InsertAllObjects |
IObservable |
Insert several objects into the cache, via the JSON serializer.
Similarly to InsertAll, partial inserts should not happen.
static
|
InsertObject |
IObservable |
Insert an object into the cache, via the JSON serializer.
static
|
InvalidateAllObjects |
IObservable |
Invalidates all objects of the specified type. To invalidate all
objects regardless of type, use InvalidateAll.
static
|
InvalidateObject |
IObservable |
Invalidates a single object from the cache. It is important that the Type
Parameter for this method be correct, and you cannot use
IBlobCache.Invalidate to perform the same task.
static
|
Extension Methods
Name | Value | Summary |
---|---|---|
Invoke |
object |
This is a thing I lifted from Prism.
|