Methods to manipulate properties and association relationships between models. More...
Public Member Functions | |
| async Task | SetModelCollectionProperty (object target, CascadePropertyInfo propertyInfo, object value) |
| Sets a collection property on a model. It ensures the property is enumerable and makes necessary type conversions. | |
| async Task | HasManyReplace (SuperModel model, string property, IEnumerable< object > models) |
| Replaces the value of the given HasMany property with the given IEnumerable of models and updates the caches appropriately. This is needed eg. when you add models to a HasMany association. | |
| async Task | HasManyAddItem (SuperModel model, string property, SuperModel hasManyItem) |
| Adds an item to the HasMany association of a model, updating both the property and the caches. | |
| async Task | HasManyReplaceItem (SuperModel model, string property, SuperModel hasManyItem) |
| Replaces an item in the association property and cached collection, matching by id. | |
| async Task | HasManyRemoveItem (SuperModel model, string property, SuperModel hasManyItem) |
| Removes an item from the association property and cached collection, matching by id. | |
| async Task | HasManyEnsureItem (SuperModel model, string property, SuperModel hasManyItem) |
| Ensures that an item occurs in the association property and cached collection, matching by id (adds or replaces as necessary to avoid duplicates). | |
| async Task | UpdateHasOne (SuperModel model, string property, object value) |
| Replaces the value of the given HasOne property with the given model. | |
| Task | SetAssociation (object target, string propertyName, object value) |
| Use this when you only want to set an association property to a value you already have. Consider using UpdateHasMany/UpdateHasOne/UpdateBelongsTo instead. This method does not update the caches. | |
| async Task | SetAssociation (IEnumerable targets, string propertyName, object value) |
| Use this when you only want to set an association property to a value you already have. Consider using UpdateHasMany/UpdateHasOne/UpdateBelongsTo instead. This method does not update the caches. | |
| async Task< byte[]?> | BlobGet (string path, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieve a binary blob identified by the given path with optional caching and freshness parameters. | |
| async Task< Stream?> | BlobGetStream (string path, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieve a binary blob identified by the given path as a Stream, with optional caching and freshness parameters. | |
| Task< OpResponse > | BlobGetResponse (string path, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieves a response containing a binary blob from the data layer based on the specified path. | |
| async Task< string?> | BlobGetFilePath (string path, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieve a binary blob identified by the given path as an absolute file path, with optional caching and freshness parameters. | |
| async Task | BlobDownload (string path, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Download a binary blob identified by the given path to a local cache. Does not return the data. Use BlobGet/BlobGetStream to get the data. | |
| async Task< bool > | BlobExists (string path, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Test whether blob identified by the given path as an absolute file path exists, with optional caching and freshness parameters. For now this uses BlobGetFilePath which means it will download the file if it exists, but in future it should be optimised to only detect existence on the origin. | |
| Task< OpResponse > | BlobGetFilePathResponse (string path, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieves a response containing a binary blob from the data layer based on the specified path. | |
| async Task< long?> | BlobGetArrivedAt (string path) |
| Get the arrivedAt timestamp of a cached blob, from the nearest cache layer holding it. Never contacts the origin. Where the cache layer can give an absolute file path, this is just a file stat - no streams are opened and no RequestOp is processed. | |
| async Task< bool > | BlobHasExpired (string path, int? fallbackSeconds=null) |
| async Task | BlobPut (string path, byte[] data) |
| Store a binary blob at the specified path. | |
| Task< OpResponse > | BlobPutResponse (string path, byte[] data) |
| Store a binary blob at the specified path, returning the OpResponse. | |
| async Task | BlobPut (string path, Stream stream) |
| Store a binary blob stream at the specified path. One day this could be made more efficient for large blobs. | |
| Task< OpResponse > | BlobPutResponse (string path, Stream stream) |
| Store a binary blob at the specified path, returning the OpResponse. | |
| async Task | BlobDestroy (string path) |
| Removes a binary blob from the specified path, effectively deleting it. | |
| Task< OpResponse > | BlobDestroyResponse (string path) |
| Generate an operation response for destroying a binary blob at the specified path. | |
| async Task< object?> | SetFromBlobProperty (SuperModel model, string property, byte[] blob) |
| Sets the property of the given model from a binary blob using the specified property's conversion attribute. | |
| async Task | BlobClear (string blobPath) |
| Removes a binary blob of the specified path from the cache (if exists) without affecting the origin. | |
| async Task | ClearBlobs (bool exceptHeld=true, DateTime? olderThan=null) |
| async Task | ClearCollection< Model > (string collectionName) |
| Clear a collection from all cache layers for the specified collection type. | |
| async Task< IEnumerable< object > > | SetCollection< Model > (string collectionName, IEnumerable< object > ids) |
| Replace a collection with a specified set of ids in all cache layers. | |
| async Task< IEnumerable< object > > | CollectionPrepend< Model > (string collectionName, object id) |
| Add a single id to the beginning of a collection in all cache layers. | |
| async Task< IEnumerable< object > > | CollectionAppend< Model > (string collectionName, object id) |
| Add a single id to the end of a collection in all cache layers. | |
| Task< IReadOnlyList< object > > | CollectionReplaceItem< Model > (string collectionName, object item) |
| Replaces an item in the collection only if it already exists. | |
| Task< IReadOnlyList< object > > | CollectionRemoveItem< Model > (string collectionName, object item) |
| Removes an item from the collection if it exists. | |
| Task< IReadOnlyList< object > > | CollectionEnsureItem< Model > (string collectionName, object item) |
| Ensures that an item exists in the collection - by replacing or adding. | |
| async Task | SetCacheWhereCollection (Type modelType, string propertyName, string propertyValue, IEnumerable< object > collection) |
| Replaces the cached values for HasMany/HasOne type associations (not typically used) Updates all cache layers with the provided association collection. | |
| async Task | SetCacheRecord (object id, object model, long? timeMs=null) |
| Replace a single cached model with a new version in all caches. | |
| async Task< long?> | GetArrivedAt< Model > (object id) |
| Get the arrivedAt timestamp of a cached record, from the nearest cache layer holding it. | |
| async Task< bool > | HasExpired< Model > (object id, int? fallbackSeconds=null) |
| async Task< long?> | GetCollectionArrivedAt< Model > (string name) |
| Get the arrivedAt timestamp of a cached collection, from the nearest cache layer holding it. | |
| async Task< bool > | HasCollectionExpired< Model > (string name, int? fallbackSeconds=null) |
| async Task | ClearLayer (int index, bool exceptHeld=true) |
| Clears all content from a specified cache layer, with the option to preserve held entries. | |
| async Task | ClearLayers (bool exceptHeld=true, DateTime? olderThan=null) |
| Clears all content from all cache layers, with options to preserve held entries and clear content based on age. | |
| async Task | ClearCache (IEnumerable< Type > modelTypes, bool clearBlobs=false, bool exceptHeld=true, DateTime? olderThan=null) |
| CascadeDataLayer (ICascadeOrigin origin, IEnumerable< ICascadeCache > cacheLayers, CascadeConfig config, ICascadePlatform cascadePlatform, ErrorControl errorControl, CascadeJsonSerialization serialization) | |
| CascadeDataLayer main constructor. | |
| void | RaisePropertyChanged ([CallerMemberName] string propertyName=null) |
| Raises this object's PropertyChanged event. | |
| async Task | EnsureAuthenticated (Type? type=null) |
| Ensures that the user is authenticated. If not, it will attempt to authenticate the user based on the provided type. | |
| IEnumerable< Type > | ListModelTypes () |
| Obtains a list of model types that the Origin can handle. | |
| string | MetaResolvePath (string path) |
| Resolves and returns the absolute path for the given relative meta path. Ensures that the path does not contain any directory traversal sequences ('..'). | |
| void | MetaSet (string path, string? value) |
| Sets a value in the metadata store for the specified key path. If the value is null, the key is removed from the store. | |
| string? | MetaGet (string path) |
| Retrieves the value associated with the specified key path in the metadata store. Returns null if the key does not exist. | |
| T? | MetaJsonGet< T > (string key) |
| void | MetaJsonSet< T > (string key, T? value) |
| bool | MetaExists (string path) |
| Checks whether a key exists in the metadata store for the given path. | |
| IEnumerable< string > | MetaList (string path, bool recursive=false, bool sort=true) |
| Lists all keys under the specified path in the metadata store. Options to list recursively and sort the results. | |
| void | MetaClearPath (string path, DateTime? olderThan=null, bool recursive=false) |
| Clears files from the specified metadata path based on optional filter criteria. Can remove files older than a specified date and can operate recursively. | |
| void | MetaClearAll () |
| Clears all metadata files and folders in the configured root meta path. | |
| void | Hold< Model > (object id) |
| Holds a model of the specified type and identifier by creating a corresponding metadata entry. | |
| void | Hold (object model) |
| Holds an object model by its type and identifier value. | |
| void | Hold (Type modelType, object id) |
| Holds a model of a specified type and identifier by creating a metadata entry. | |
| bool | IsHeld< Model > (object id) |
| Checks if a model of the specified type and identifier is currently held. | |
| void | Unhold< Model > (object id) |
| Unholds a model of the specified type and identifier by removing the metadata entry. | |
| void | HoldBlob (string path) |
| Holds a blob path by creating a corresponding metadata entry. | |
| void | UnholdBlob (string path) |
| Unholds a blob path by removing the corresponding metadata entry. | |
| bool | IsHeldBlob (string path) |
| Checks if a blob path is currently held in the metadata. | |
| IEnumerable< object > | ListHeldIds< Model > () |
| Lists all identifiers of a specified model type that are currently held. | |
| IEnumerable< object > | ListHeldIds (Type type) |
| Lists all identifiers of the specified type currently held in metadata. Differentiates between blob and non-blob types. | |
| IEnumerable< object > | ListHeldBlobPaths () |
| Lists all blob paths currently held in metadata. | |
| void | HoldCollection< Model > (string name) |
| Holds a named collection for a model type by creating a corresponding metadata entry. | |
| void | HoldCollection (Type modelType, string name) |
| Holds a named collection for a specified model type by creating a metadata entry. | |
| void | UnholdCollection< Model > (string name) |
| Unholds a named collection for a model type by removing the corresponding metadata entry. | |
| bool | IsCollectionHeld< Model > (string name) |
| Checks if a named collection for a model type is currently held. | |
| IEnumerable< object > | ListHeldCollections (Type modelType) |
| Lists all named collections of a specified model type that are currently held. | |
| void | UnholdAll (Type modelType, DateTime? olderThan=null) |
| Unholds all instances and collections of the specified model type. Optionally filter out entries older than a specified date. | |
| void | UnholdAllBlobs (DateTime? olderThan=null) |
| void | UnholdAll (DateTime? olderThan) |
| Unholds all models and collections, clearing all associated metadata. Can target only metadata entries older than a specified date. | |
| void | UnholdAll () |
| Unholds all associations in both model and collection types, clearing all metadata. | |
| JsonNode | SerializeRequestOp (RequestOp op, out IReadOnlyDictionary< string, byte[]> externalContent) |
| Serializes a RequestOp object into a JsonNode while also extracting and returning any external content. | |
| RequestOp | DeserializeRequestOp (string? s, out IReadOnlyDictionary< string, string > externals) |
| Deserializes a JSON string into a RequestOp object while extracting any external links. | |
| async Task< string > | AddPendingChange (RequestOp op) |
| Adds a new pending RequestOp change to the system and saves it in a designated path. | |
| string | ExternalBinaryPathFromPendingChangePath (string filePath, string externalPath) |
| Converts a pending change file path to its corresponding binary file path. | |
| IEnumerable< string > | GetChangesPendingList () |
| Retrieves a list of pending change filenames from the configured directory. | |
| async Task< List< Tuple< string, RequestOp, IReadOnlyDictionary< string, string >?> > > | GetChangesPending () |
| Retrieves and reconstructs a list of pending RequestOps with associated external file links. | |
| bool | HasChangesPending () |
| Checks if there are any pending changes stored in the system. | |
| async Task | ClearChangesPending () |
| Clears all pending changes by deleting their stored files. | |
| async Task | UploadChangesPending (Action< string >? progressMessage=null, Action< int >? progressCount=null) |
| Uploads all pending changes, processes them, and removes the changes once uploaded. | |
| async Task | ProcessAndRemovePendingChange (Tuple< string, RequestOp, IReadOnlyDictionary< string, string >?> change) |
| Process a single change from GetChangesPending() and remove it from the ChangesPending store. | |
| async Task | RemoveChangePending (string main, IEnumerable< string >? externals) |
| Removes a main pending change file along with its associated external files. | |
| async Task | Populate (IEnumerable< SuperModel > models, IEnumerable< string > associations, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool skipIfSet=false, bool? hold=null, long? sequenceBeganMs=null) |
| Populates one or more association properties on each of the given models using the association attribute definitions. | |
| async Task | Populate (SuperModel model, string association, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool skipIfSet=false, bool? hold=null, long? sequenceBeganMs=null) |
| Populates a specified association property on a given model based on its association attribute definition (BelongsTo/HasMany/HasOne). | |
| async Task | Populate (SuperModel model, IEnumerable< string > associations, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool skipIfSet=false, bool? hold=null, long? sequenceBeganMs=null) |
| Populates specified association properties on a given model with data based on association attribute definitions. | |
| async Task | Populate (IEnumerable< SuperModel > models, string association, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool skipIfSet=false, bool? hold=null, long? sequenceBeganMs=null) |
| Populates a specific association property on each of the provided models using its association attribute definition. | |
| async Task< M?> | Get< M > (int id, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null, object? criteria=null) |
| Retrieves data from cache or origin of model type M based on a numerical ID and returns the result or null. | |
| async Task< M?> | Get< M > (string id, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieves data from cache or origin of model type M based on a string ID and returns the result or null. | |
| async Task< M?> | Get< M > (long id, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieves data from cache or origin of model type M based on a long ID and returns the result or null. | |
| Task< OpResponse > | GetResponse (Type modelType, object id, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null, object? criteria=null) |
| Retrieves a model instance of the given model type and ID with a full detail OpResponse object. | |
| async Task< IEnumerable< OpResponse > > | GetModelResponsesForIds (Type type, IEnumerable iids, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| Retrieves models of the given type for a multitude of IDs. | |
| async Task< IEnumerable< Model > > | GetModelsForIds< Model > (IEnumerable iids, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null) |
| async Task< IEnumerable< object >?> | GetCollection< M > (string collectionName, long? sequenceBeganMs=null, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null) |
| Gets a collection literally, i.e., an enumerable of IDs. | |
| Task< OpResponse > | GetCollectionResponse< M > (string collectionName, long? sequenceBeganMs=null, int? freshnessSeconds=null, int? fallbackFreshnessSeconds=null) |
| Retrieves a collection as an enumerable of IDs with full detail as an OpResponse. | |
| async Task< OpResponse > | GetWhereCollectionResponse< Model > (string propertyName, string propertyValue, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, long? sequenceBeganMs=null) |
| Used for populating HasMany or HasOne associations based on a foreign key. | |
| async Task< IEnumerable< M > > | GetWhereCollection< M > (string propertyName, string propertyValue, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, long? sequenceBeganMs=null) |
| Used for populating HasMany or HasOne associations based on a foreign key. | |
| async Task< IEnumerable< M > > | Query< M > (string? collectionKey, object? criteria=null, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null, bool? localOnly=null) |
| Performs a query on the origin with the given model and criteria, caching the resulting collection under collectionKey. | |
| async Task< M?> | QueryOne< M > (string? collectionKey, object criteria=null, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null, bool? localOnly=null) |
| Performs a query on the origin with the given model and criteria for a single record. Caches the result under the collectionKey. | |
| Task< OpResponse > | QueryResponse< M > (string? collectionName, object? criteria, IEnumerable< string >? populate=null, int? freshnessSeconds=null, int? populateFreshnessSeconds=null, int? fallbackFreshnessSeconds=null, bool? hold=null, long? sequenceBeganMs=null, bool? localOnly=null) |
| Performs a query on the origin with the given model and criteria, caching the resulting collection under collectionKey and returns a full detail OpResponse. | |
| async Task< M > | Create< M > (M model, bool hold=false) |
| Create and return a model of the given type. An instance is used to pass in the values, and a newly created instance is returned from the origin. Note: the populate option will be removed from all write methods. Instead Create should be called followed by any call(s) to Populate() as required. | |
| Task< OpResponse > | CreateResponse< M > (M model, bool hold=false) |
| Create and return a model of the given type. An instance is used to pass in the values, and a newly created instance is returned from the origin. Note: the populate option will be removed from all write methods. Instead Create should be called followed by any call(s) to Populate() as required. | |
| async Task< M > | Replace< M > (M model) |
| Replaces the given model with a new instance. | |
| Task< OpResponse > | ReplaceResponse< M > (M model) |
| Generates a response for replacing the given model with a new instance. | |
| async Task< M?> | Update< M > (M model, IDictionary< string, object?> changes) |
| Updates the given model with specified changes. Returns null if the record no longer exists. | |
| Task< OpResponse > | UpdateResponse< M > (M model, IDictionary< string, object?> changes) |
| Generates a response for updating the given model with specified changes. | |
| async Task | Destroy< M > (M model) |
| Permanently removes the given model. | |
| Task< OpResponse > | DestroyResponse< M > (M model) |
| Generates a response for destroying the given model. | |
| async Task< ReturnType?> | Execute< ModelType, ReturnType > (string action, IDictionary< string, object?> parameters) |
| Executes a specified action on a model type and returns a result of the specified return type. | |
| Task< OpResponse > | ExecuteResponse< ModelType, ReturnType > (string action, IDictionary< string, object?> parameters) |
| Execute a specified action on a model type - returns a OpResponse. | |
Static Public Member Functions | |
| static string | EncodeBlobPath (string path) |
| Encodes a blob path by replacing slashes with the alternative separator. | |
| static string | DecodeBlobPath (string path) |
| Decodes an encoded blob path by reverting the alternative separator back to slashes. | |
| static string | HoldModelPath (string typeFolder, object? id=null) |
| Constructs and returns a path for holding a model of the specified type in the hold directory. | |
Public Attributes | |
| readonly CascadeConfig | Config |
| readonly ICascadeOrigin | Origin |
Static Public Attributes | |
| static ImmutableArray< Type > | AssociationAttributes |
| const string | BLOB_PATH_ALT_SEPARATOR = "_%_" |
Protected Member Functions | |
| async Task | HasManyReplaceRemoveItem (SuperModel model, string property, SuperModel hasManyItem, bool remove=false, bool ensureItem=false) |
| Utility method to either replace or remove an item from a HasMany association while optionally ensuring the item is present. | |
| async Task< IReadOnlyList< object > > | CollectionReplaceRemoveItem< Model > (string collectionName, object item, bool remove=false, bool ensureItem=false) |
| Utility method to either replace or remove an item from a HasMany association while optionally ensuring the item is present. | |
| virtual void | OnPropertyChanged ([CallerMemberName] string? propertyName=null) |
| bool | SetField< T > (ref T field, T value, [CallerMemberName] string? propertyName=null) |
| Sets a field's value and triggers a property change notification if the value has changed. | |
Properties | |
| long | NowMs [get] |
| Use this timestamp to keep in sync with the framework. Especially useful for testing as time can then be controlled by your origin implementation. Milliseconds since 1970. | |
| bool | ConnectionOnline [get, set] |
| This property determines whether the framework acts in online (true) or offline (false) mode. It can be set to offline at any time, but should not be set to online unless the changes pending list is empty. ReconnectOnline() uploads changes and sets ConnectionOnline=true for you.. | |
| int | PendingCount [get] |
| Gets the count of pending changes when the connection is offline. | |
Events | |
| PropertyChangedEventHandler | PropertyChanged |
| Used for watching properties on this (normally ConnectionOnline). | |
Methods to manipulate properties and association relationships between models.
Provides methods used by applications for creating, updating, replacing, and deleting models, as well as executing actions.
Methods used by an application for reading (Get and Query).
Methods to populate properties of models with data based on their association attributes.
Methods for internal core data operations (Get/Query/Create/Update/Destroy) including processing relationships such as HasMany, HasOne, BelongsTo, and FromBlob on a data model. It interacts with various cache layers and origin layers to fulfill data requests and ensure data consistency.
Methods to serialize, deserialize, store, and manage pending operations for offline (ConnectionOnline == false).
Methods to manipulate and query metadata and holding.
The main class for all data requests and other operations. This would generally only be created once on startup of an application.
Functionality to manage cached collections and records, offering operations such as clearing, setting, and updating collections and individual records in the cascading caching system.
Functionality for retrieving, storing, and deleting binary blobs identified by a unique path.
|
inline |
CascadeDataLayer main constructor.
| origin | Origin server |
| cacheLayers | Cache layers in order. Typically this would be an instance of a memory cache followed by a file based cache. |
| config | configuration for cascade |
| cascadePlatform | platform specific implementation |
| errorControl | instance for managing exceptions |
| serialization | instance for serializing models |
|
inline |
Adds a new pending RequestOp change to the system and saves it in a designated path.
| op | The RequestOp representing the change |
|
inline |
Removes a binary blob of the specified path from the cache (if exists) without affecting the origin.
| blobPath | Path identifying the blob to be cleared from the cache |
|
inline |
Removes a binary blob from the specified path, effectively deleting it.
| path | Path identifying the blob to be deleted |
|
inline |
Generate an operation response for destroying a binary blob at the specified path.
| path | Path of the blob to be destroyed |
|
inline |
Download a binary blob identified by the given path to a local cache. Does not return the data. Use BlobGet/BlobGetStream to get the data.
| path | Identifier for the blob |
| freshnessSeconds | Desired freshness duration in seconds for the cache |
| fallbackFreshnessSeconds | Fallback freshness duration if primary freshness cannot be achieved |
| hold | Indicates if the blob and its associations should be held in cache |
| sequenceBeganMs | The request timestamp in milliseconds since epoch, for caching optimization |
|
inline |
Test whether blob identified by the given path as an absolute file path exists, with optional caching and freshness parameters. For now this uses BlobGetFilePath which means it will download the file if it exists, but in future it should be optimised to only detect existence on the origin.
| path | Identifier for the blob |
| freshnessSeconds | Desired freshness duration in seconds for the cache |
| fallbackFreshnessSeconds | Fallback freshness duration if primary freshness cannot be achieved |
| hold | Indicates if the blob and its associations should be held in cache |
| sequenceBeganMs | The request timestamp in milliseconds since epoch, for caching optimization |
|
inline |
Retrieve a binary blob identified by the given path with optional caching and freshness parameters.
| path | Identifier for the blob |
| freshnessSeconds | Desired freshness duration in seconds for the cache |
| fallbackFreshnessSeconds | Fallback freshness duration if primary freshness cannot be achieved |
| hold | Indicates if the blob and its associations should be held in cache |
| sequenceBeganMs | The request timestamp in milliseconds since epoch, for caching optimization |
|
inline |
Get the arrivedAt timestamp of a cached blob, from the nearest cache layer holding it. Never contacts the origin. Where the cache layer can give an absolute file path, this is just a file stat - no streams are opened and no RequestOp is processed.
| path | Identifier for the blob |
|
inline |
Retrieve a binary blob identified by the given path as an absolute file path, with optional caching and freshness parameters.
| path | Identifier for the blob |
| freshnessSeconds | Desired freshness duration in seconds for the cache |
| fallbackFreshnessSeconds | Fallback freshness duration if primary freshness cannot be achieved |
| hold | Indicates if the blob and its associations should be held in cache |
| sequenceBeganMs | The request timestamp in milliseconds since epoch, for caching optimization |
|
inline |
Retrieves a response containing a binary blob from the data layer based on the specified path.
| path | Path of the blob to be retrieved |
| freshnessSeconds | Desired freshness of the blob in seconds |
| fallbackFreshnessSeconds | Fallback freshness in case the primary cannot be achieved |
| hold | Flag to hold the blob in cache for offline availability |
| sequenceBeganMs | Request timestamp in milliseconds since epoch |
|
inline |
Retrieves a response containing a binary blob from the data layer based on the specified path.
| path | Path of the blob to be retrieved |
| freshnessSeconds | Desired freshness of the blob in seconds |
| fallbackFreshnessSeconds | Fallback freshness in case the primary cannot be achieved |
| hold | Flag to hold the blob in cache for offline availability |
| sequenceBeganMs | Request timestamp in milliseconds since epoch |
|
inline |
Retrieve a binary blob identified by the given path as a Stream, with optional caching and freshness parameters.
| path | Identifier for the blob |
| freshnessSeconds | Desired freshness duration in seconds for the cache |
| fallbackFreshnessSeconds | Fallback freshness duration if primary freshness cannot be achieved |
| hold | Indicates if the blob and its associations should be held in cache |
| sequenceBeganMs | The request timestamp in milliseconds since epoch, for caching optimization |
|
inline |
Store a binary blob at the specified path.
| path | Path where the blob will be stored |
| data | The binary data to be stored |
|
inline |
Store a binary blob stream at the specified path. One day this could be made more efficient for large blobs.
| path | Path where the blob will be stored |
| data | The binary data to be stored |
|
inline |
Store a binary blob at the specified path, returning the OpResponse.
| path | Path to store the blob data |
| data | Binary data to be stored |
|
inline |
Store a binary blob at the specified path, returning the OpResponse.
| path | Path to store the blob stream |
| stream | Binary stream to be stored |
|
inline |
Clear a collection from all cache layers for the specified collection type.
| collectionName | The name of the collection to be cleared from the cache. |
| Model | Specifies the model type of the collection. |
|
inline |
Clears all content from a specified cache layer, with the option to preserve held entries.
| index | The index of the cache layer to be cleared. |
| exceptHeld | If true, entries marked as held will not be cleared. |
|
inline |
Clears all content from all cache layers, with options to preserve held entries and clear content based on age.
| exceptHeld | If true, entries marked as held will not be cleared. |
| olderThan | Optional: clear only items older than this DateTime. |
|
inline |
Add a single id to the end of a collection in all cache layers.
| collectionName | The name of the collection to be updated. |
| id | The id to append to the collection. |
| Model | Specifies the model type of the collection. |
| Model | : | class |
|
inline |
Ensures that an item exists in the collection - by replacing or adding.
| collectionName | |
| item |
| Model | : | class |
|
inline |
Add a single id to the beginning of a collection in all cache layers.
| collectionName | The name of the collection to be updated. |
| id | The id to prepend to the collection. |
| Model | Specifies the model type of the collection. |
| Model | : | class |
|
inline |
Removes an item from the collection if it exists.
| collectionName | |
| item |
| Model | : | class |
|
inline |
Replaces an item in the collection only if it already exists.
| collectionName | |
| item |
| Model | : | class |
|
inlineprotected |
Utility method to either replace or remove an item from a HasMany association while optionally ensuring the item is present.
| collectionName | the name of the collection to modify |
| item | the item - can be a string (eg. a collection name for a collection of collections) or number - doesn't have to be a valid id in the collection |
| remove | Specifies whether to remove the item from the association. |
| ensureItem | Indicates if the item should be ensured in the association, avoiding duplicates. |
| Model | : | class |
|
inline |
Create and return a model of the given type. An instance is used to pass in the values, and a newly created instance is returned from the origin. Note: the populate option will be removed from all write methods. Instead Create should be called followed by any call(s) to Populate() as required.
| M | The type of the model to be created. |
| model | The model instance containing values to create a new entry from. |
| hold | Indicates whether to hold the operation. |
|
inline |
Create and return a model of the given type. An instance is used to pass in the values, and a newly created instance is returned from the origin. Note: the populate option will be removed from all write methods. Instead Create should be called followed by any call(s) to Populate() as required.
| M | The type of the model to be created. |
| model | The model instance containing values to create a new entry from. |
| hold | Indicates whether to hold the operation. |
|
inlinestatic |
Decodes an encoded blob path by reverting the alternative separator back to slashes.
| path | The encoded blob path to decode. |
|
inline |
Deserializes a JSON string into a RequestOp object while extracting any external links.
| s | The serialized JSON string representation of the RequestOp |
| externals | Dictionary of external file links found during deserialization |
|
inline |
Permanently removes the given model.
| M | The type of the model to be destroyed. |
| model | The model instance to destroy. |
|
inline |
Generates a response for destroying the given model.
| M | The type of the model to be destroyed. |
| model | The model instance to destroy. |
|
inlinestatic |
Encodes a blob path by replacing slashes with the alternative separator.
| path | The blob path to encode. |
|
inline |
Ensures that the user is authenticated. If not, it will attempt to authenticate the user based on the provided type.
| type | The type used for authentication, can be null. |
true if the user is authenticated; otherwise, false.
|
inline |
Executes a specified action on a model type and returns a result of the specified return type.
| ModelType | The type of model on which the action is executed. |
| ReturnType | The type that will be returned after execution, could be the same or different from ModelType. |
| action | The action to execute. |
| parameters | Parameters required for executing the action. |
|
inline |
Execute a specified action on a model type - returns a OpResponse.
| ModelType | The type of model on which the action is executed. |
| ReturnType | The type that will be returned after execution. |
| action | The action to execute. |
| parameters | Parameters required for executing the action. |
|
inline |
Converts a pending change file path to its corresponding binary file path.
| filePath | The path of the original file |
| externalPath | The name of the external segment to append |
|
inline |
Retrieves data from cache or origin of model type M based on a numerical ID and returns the result or null.
| id | ID of model to retrieve. |
| populate | Enumerable association property names to set with data for convenience. Equivalent to multiple Get/Query requests. |
| freshnessSeconds | Freshness duration for the main object. |
| populateFreshnessSeconds | Freshness duration for any populated associations. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Indicates whether to mark the main object and populated associations to be held in cache. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. Ideally, a group of requests will be given the same time to optimize caching. |
| M | Model type, which is a subclass of SuperModel. |
| M | : | class |
|
inline |
Retrieves data from cache or origin of model type M based on a long ID and returns the result or null.
| id | ID of model to retrieve. |
| populate | Enumerable association property names to set with data for convenience. Equivalent to multiple Get/Query requests. |
| freshnessSeconds | Freshness duration for the main object. |
| populateFreshnessSeconds | Freshness duration for any populated associations. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Indicates whether to mark the main object and populated associations to be held in cache. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. Ideally, a group of requests will be given the same time to optimize caching. |
| M | Model type, which is a subclass of SuperModel. |
| M | : | class |
|
inline |
Retrieves data from cache or origin of model type M based on a string ID and returns the result or null.
| id | ID of model to retrieve. |
| populate | Enumerable association property names to set with data for convenience. Equivalent to multiple Get/Query requests. |
| freshnessSeconds | Freshness duration for the main object. |
| populateFreshnessSeconds | Freshness duration for any populated associations. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Indicates whether to mark the main object and populated associations to be held in cache. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. Ideally, a group of requests will be given the same time to optimize caching. |
| M | Model type, which is a subclass of SuperModel. |
| M | : | class |
|
inline |
Get the arrivedAt timestamp of a cached record, from the nearest cache layer holding it.
| id | The unique identifier of the model. |
| Model | Specifies the model type of the record. |
| Model | : | class |
|
inline |
Retrieves and reconstructs a list of pending RequestOps with associated external file links.
|
inline |
Retrieves a list of pending change filenames from the configured directory.
|
inline |
Gets a collection literally, i.e., an enumerable of IDs.
| collectionName | User-defined name for the collection. |
| sequenceBeganMs | |
| freshnessSeconds | |
| fallbackFreshnessSeconds |
| M | The type of the collection. |
| M | : | class |
|
inline |
Get the arrivedAt timestamp of a cached collection, from the nearest cache layer holding it.
| name | The name of the collection. |
| Model | Specifies the model type of the collection. |
| Model | : | class |
|
inline |
Retrieves a collection as an enumerable of IDs with full detail as an OpResponse.
| collectionName | User-defined name for the collection. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. |
| freshnessSeconds | |
| fallbackFreshnessSeconds |
| M | The type of the collection. |
|
inline |
Retrieves models of the given type for a multitude of IDs.
| type | The type of models to retrieve. |
| iids | An enumerable list of IDs for which models are to be retrieved. |
| freshnessSeconds | Freshness duration for the retrieved objects. |
| fallbackFreshnessSeconds | Fallback freshness requirement. |
| hold | Indicates whether to mark the retrieved objects to be held in cache. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. |
|
inline |
Retrieves a model instance of the given model type and ID with a full detail OpResponse object.
| modelType | |
| id | ID of model to retrieve. |
| populate | Enumerable association property names to set with data for convenience. |
| freshnessSeconds | Freshness duration for the main object. |
| populateFreshnessSeconds | Freshness duration for any populated associations. |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| hold | Indicates whether to mark the main object and populated associations to be held in cache. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. |
| criteria |
|
inline |
Used for populating HasMany or HasOne associations based on a foreign key.
| propertyName | Name of the foreign key. |
| propertyValue | Value of the foreign key. |
| freshnessSeconds | Freshness duration for the main object. |
| populateFreshnessSeconds | Freshness duration for any populated associations. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. |
| Model | The type of the collection. |
| M | : | class |
|
inline |
Used for populating HasMany or HasOne associations based on a foreign key.
| propertyName | Name of the foreign key. |
| propertyValue | Value of the foreign key. |
| freshnessSeconds | Freshness duration for the main object. |
| populateFreshnessSeconds | Freshness duration for any populated associations. |
| sequenceBeganMs | (Optional) Request time represented as milliseconds since 1970. |
| Model | The type of the collection. |
|
inline |
Checks if there are any pending changes stored in the system.
|
inline |
| Model | : | class |
|
inline |
| Model | : | class |
|
inline |
Adds an item to the HasMany association of a model, updating both the property and the caches.
| model | The main model to be updated. |
| property | The name of the HasMany property on the model. |
| hasManyItem | The item to add to the association. |
| ArgumentException | Thrown if the property is not a HasMany property. |
|
inline |
Ensures that an item occurs in the association property and cached collection, matching by id (adds or replaces as necessary to avoid duplicates).
| model | The model to update. |
| property | The name of the association property. |
| hasManyItem | The item to ensure in the association. |
|
inline |
Removes an item from the association property and cached collection, matching by id.
| model | The model from which the item is being removed. |
| property | The name of the association property. |
| hasManyItem | The item to remove from the association. |
|
inline |
Replaces the value of the given HasMany property with the given IEnumerable of models and updates the caches appropriately. This is needed eg. when you add models to a HasMany association.
| model | The model for which the property is being replaced. |
| property | The name of the HasMany property on the model. |
| models | The new models to set for the association. |
| ArgumentException |
|
inline |
Replaces an item in the association property and cached collection, matching by id.
| model | The model in which the item is being replaced. |
| property | The name of the association property. |
| hasManyItem | The new item for the association. |
|
inlineprotected |
Utility method to either replace or remove an item from a HasMany association while optionally ensuring the item is present.
| model | The main model to be updated. |
| property | The name of the HasMany property on the model. |
| hasManyItem | The item to be removed, replaced, or ensured in the association. |
| remove | Specifies whether to remove the item from the association. |
| ensureItem | Indicates if the item should be ensured in the association, avoiding duplicates. |
|
inline |
Holds an object model by its type and identifier value.
| model | The model instance to hold. |
|
inline |
Holds a model of a specified type and identifier by creating a metadata entry.
| modelType | The Type of the model to hold. |
| id | The identifier of the model to hold. |
|
inline |
Holds a model of the specified type and identifier by creating a corresponding metadata entry.
| Model | The model type to hold. |
| id | The identifier of the model to hold. |
|
inline |
Holds a blob path by creating a corresponding metadata entry.
| path | The blob path to hold. |
|
inline |
Holds a named collection for a specified model type by creating a metadata entry.
| modelType | The Type of the model collection to hold. |
| name | The name of the collection to hold. |
|
inline |
Holds a named collection for a model type by creating a corresponding metadata entry.
| Model | The model type for the collection to hold. |
| name | The name of the collection to hold. |
|
inlinestatic |
Constructs and returns a path for holding a model of the specified type in the hold directory.
| typeFolder | The folder type associated with the model. |
| id | Optional ID of the model, used to construct sub-paths. |
|
inline |
Checks if a named collection for a model type is currently held.
| Model | The model type of the collection to check. |
| name | The name of the collection to check. |
|
inline |
Checks if a model of the specified type and identifier is currently held.
| Model | The model type to check. |
| id | The identifier of the model to check. |
|
inline |
Checks if a blob path is currently held in the metadata.
| path | The blob path to check. |
|
inline |
Lists all blob paths currently held in metadata.
|
inline |
Lists all named collections of a specified model type that are currently held.
| modelType | The Type of the model collections to list. |
|
inline |
Lists all identifiers of the specified type currently held in metadata. Differentiates between blob and non-blob types.
| type | The Type to list held identifiers for. |
|
inline |
Lists all identifiers of a specified model type that are currently held.
| Model | The model type whose held identifiers are to be listed. |
|
inline |
Obtains a list of model types that the Origin can handle.
|
inline |
Clears files from the specified metadata path based on optional filter criteria. Can remove files older than a specified date and can operate recursively.
| path | The path to clear the files or folders. |
| olderThan | The optional DateTime to check if files are older to be deleted. |
| recursive | Whether to delete files recursively. |
|
inline |
Checks whether a key exists in the metadata store for the given path.
| path | The relative key path to check for existence. |
|
inline |
Retrieves the value associated with the specified key path in the metadata store. Returns null if the key does not exist.
| path | The relative path (key) to retrieve the value for. |
|
inline |
Lists all keys under the specified path in the metadata store. Options to list recursively and sort the results.
| path | The relative path to list keys from. |
| recursive | Whether to list recursively through all subdirectories. |
| sort | Whether to sort the resulting list of keys. |
|
inline |
Resolves and returns the absolute path for the given relative meta path. Ensures that the path does not contain any directory traversal sequences ('..').
| path | The relative path that needs resolution. |
|
inline |
Sets a value in the metadata store for the specified key path. If the value is null, the key is removed from the store.
| path | The relative path (key) in the metadata store. |
| value | The value to associate with the key. Null to remove the key. |
|
inline |
Populates one or more association properties on each of the given models using the association attribute definitions.
| models | A collection of models to act upon |
| associations | A list of associations to populate for each model |
| freshnessSeconds | Specifies how fresh the data should be by setting the freshness in seconds |
| fallbackFreshnessSeconds | Fallback freshness setting, used if the main requirement cannot be fulfilled. Defaults to FRESHNESS_ANY. |
| sequenceBeganMs | Optional request time (milliseconds since 1970) for optimizing caching when multiple requests share the same time |
| skipIfSet | If set to true, skips any associations where the property is already filled |
| hold | Specifies whether to maintain the acquired data after the method completes |
|
inline |
Populates a specific association property on each of the provided models using its association attribute definition.
| models | The collection of models to be populated |
| property | The property name that each model should populate based on its association attribute definition |
| association | The association to populate for each given model |
| freshnessSeconds | The maximum age in seconds for the data to be considered fresh |
| fallbackFreshnessSeconds | Defines a fallback freshness if the main constraint cannot be met. Defaults to FRESHNESS_ANY. |
| skipIfSet | Skip the operation for properties that have already been set, improving performance |
| hold | Determines if the data will persist after execution |
| sequenceBeganMs | An optional time in milliseconds since 1970 to be applied to optimize caching for grouped requests |
|
inline |
Populates specified association properties on a given model with data based on association attribute definitions.
| model | The model to which the association properties will be applied |
| associations | List of associations to populate |
| freshnessSeconds | Defines how fresh the data should be, measured in seconds |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| skipIfSet | If true, skips all associations for which the properties are already set |
| hold | Determines whether to hold the data during the operation |
| sequenceBeganMs | Optional request time (milliseconds since 1970) for optimizing caching |
|
inline |
Populates a specified association property on a given model based on its association attribute definition (BelongsTo/HasMany/HasOne).
| model | The model to apply the association on |
| association | The property name on the model that is to be populated |
| freshnessSeconds | Defines how fresh the data should be, measured in seconds |
| fallbackFreshnessSeconds | Fallback freshness requirement if the main requirement cannot be met. Defaults to FRESHNESS_ANY. |
| skipIfSet | If true and the property is already set, the operation will be skipped for performance reasons |
| hold | Determines whether to hold the data or not during the operation |
| sequenceBeganMs | Optional request time (milliseconds since 1970) used for optimizing caching when a group of requests share the same time |
|
inline |
Process a single change from GetChangesPending() and remove it from the ChangesPending store.
| change |
|
inline |
Performs a query on the origin with the given model and criteria, caching the resulting collection under collectionKey.
| collectionKey | Key under which the collection will be cached. |
| criteria | Filtering criteria for the query. |
| populate | Association names to populate with data. |
| freshnessSeconds | Freshness duration for main objects. |
| populateFreshnessSeconds | Freshness duration for populated associations. |
| fallbackFreshnessSeconds | Fallback freshness requirement if main requirement is not met. |
| hold | Whether to hold objects in cache. |
| sequenceBeganMs | (Optional) Request time as milliseconds since 1970 for optimized caching. |
| localOnly |
| M | Model type to query. |
|
inline |
Performs a query on the origin with the given model and criteria for a single record. Caches the result under the collectionKey.
| collectionKey | Key under which collection will be cached. |
| criteria | Filtering criteria for the query. |
| populate | Association names to populate with data. |
| freshnessSeconds | Freshness duration for main objects. |
| populateFreshnessSeconds | Freshness duration for populated associations. |
| fallbackFreshnessSeconds | Fallback freshness requirement if main requirement is not met. |
| hold | Whether to hold objects in cache. |
| sequenceBeganMs | (Optional) Request time as milliseconds since 1970 for optimized caching. |
| localOnly |
| M | Model type to query. |
|
inline |
Performs a query on the origin with the given model and criteria, caching the resulting collection under collectionKey and returns a full detail OpResponse.
| collectionName | |
| criteria | Filtering criteria for the query. |
| populate | Association names to populate with data. |
| freshnessSeconds | Freshness duration for main objects. |
| populateFreshnessSeconds | Freshness duration for populated associations. |
| fallbackFreshnessSeconds | Fallback freshness requirement if main requirement is not met. |
| hold | Whether to hold objects in cache. |
| sequenceBeganMs | (Optional) Request time as milliseconds since 1970 for optimized caching. |
| localOnly | |
| collectionKey | Key under which collection will be cached. |
| M | Model type to query. |
|
inline |
Raises this object's PropertyChanged event.
| propertyName | Name of the property used to notify listeners. This value is optional and can be provided automatically when invoked from compilers that support CallerMemberNameAttribute. |
|
inline |
Removes a main pending change file along with its associated external files.
| main | The main file to remove |
| externals | An enumeration of associated external files to remove |
|
inline |
Replaces the given model with a new instance.
| M | The type of the model to be replaced. |
| model | The model instance to replace. |
|
inline |
Generates a response for replacing the given model with a new instance.
| M | The type of the model to be replaced. |
| model | The model instance to replace. |
|
inline |
Serializes a RequestOp object into a JsonNode while also extracting and returning any external content.
| op | The RequestOp object to serialize |
| externalContent | Dictionary containing the external content if any (key: filename suffix, value: content) |
|
inline |
Use this when you only want to set an association property to a value you already have. Consider using UpdateHasMany/UpdateHasOne/UpdateBelongsTo instead. This method does not update the caches.
| targets | The models to act on. |
| propertyName | The name of the association property to set. |
| value | The value to set for the association property. |
|
inline |
Use this when you only want to set an association property to a value you already have. Consider using UpdateHasMany/UpdateHasOne/UpdateBelongsTo instead. This method does not update the caches.
| target | The model to act on. |
| propertyName | The name of the association property to set. |
| value | The value to set for the association property. |
|
inline |
Replace a single cached model with a new version in all caches.
| id | The unique identifier of the model to be replaced. |
| model | The new model object to store in the cache. |
| timeMs | Optional: specific time in milliseconds since 1970 for the caching record's timestamp. |
|
inline |
Replaces the cached values for HasMany/HasOne type associations (not typically used) Updates all cache layers with the provided association collection.
| modelType | The type of model for which the association cache is being replaced. |
| propertyName | The foreign key property name that defines the association. |
| propertyValue | The foreign key property value that defines the association. |
| collection | An enumerable of ids representing the new association values. |
|
inline |
Replace a collection with a specified set of ids in all cache layers.
| collectionName | The name of the collection to be updated. |
| ids | An enumerable list of ids representing the new collection content. |
| Model | Specifies the model type of the collection. |
| Model | : | class |
|
inlineprotected |
Sets a field's value and triggers a property change notification if the value has changed.
| T | Type of the field value. |
| field | The reference to the backing field. |
| value | The new value to set. |
| propertyName | The name of the property (automatically provided). |
|
inline |
Sets the property of the given model from a binary blob using the specified property's conversion attribute.
| model | The model instance where the property will be set |
| property | Name of the property to set |
| blob | Binary data to be converted and assigned to the property |
|
inline |
Sets a collection property on a model. It ensures the property is enumerable and makes necessary type conversions.
| target | The model on which the property is being set. |
| propertyInfo | The metadata of the property to set. |
| value | The value to set for the property. Must be an IEnumerable. |
| ArgumentException | Thrown when the property type or value types are incorrect. |
|
inline |
Unholds a model of the specified type and identifier by removing the metadata entry.
| Model | The model type to unhold. |
| id | The identifier of the model to unhold. |
|
inline |
Unholds all models and collections, clearing all associated metadata. Can target only metadata entries older than a specified date.
| olderThan | Optional DateTime to filter which holds should be cleared. |
|
inline |
Unholds all instances and collections of the specified model type. Optionally filter out entries older than a specified date.
| modelType | The Type of the model to clear holds for. |
| olderThan | Optional DateTime to filter which holds should be cleared. |
|
inline |
Unholds a blob path by removing the corresponding metadata entry.
| path | The blob path to unhold. |
|
inline |
Unholds a named collection for a model type by removing the corresponding metadata entry.
| Model | The model type of the collection to unhold. |
| name | The name of the collection to unhold. |
|
inline |
Updates the given model with specified changes. Returns null if the record no longer exists.
| M | The type of the model to be updated. |
| model | The model instance to update. |
| changes | Dictionary containing changes to apply to the model. |
| M | : | class |
|
inline |
Replaces the value of the given HasOne property with the given model.
| model | The main model to update. |
| property | The name of the HasOne property on the main model. |
| value | The new model for the association. |
| ArgumentException | Thrown if the property is not a HasOne property. |
|
inline |
Generates a response for updating the given model with specified changes.
| M | The type of the model to be updated. |
| model | The model instance to update. |
| changes | Dictionary containing changes to apply to the model. |
|
inline |
Uploads all pending changes, processes them, and removes the changes once uploaded.
| progressMessage | Optional action to report progress messages |
| progressCount | Optional action to report remaining count of pending changes |
|
static |