ItemBaseRepositoryT Class

Represents a base repository for a MobileTrack Business Object. Each MobileTrack Business Object gets its own IAzureCosmosDb Container and create, update, get and delete functions. (because of partition keys and other parameters) Local caching is also handled by the BaseRepository

Definition

Namespace: MobileTrack.DataContainers.Repositories
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.8+34f1bbd8dc6b32752cfce829cbed66e15113d7ba
internal abstract class ItemBaseRepository<T>
where T : IIdLabel
Inheritance
Object    ItemBaseRepositoryT
Derived
More

Type Parameters

T
The Business Object type. Must be a class that derives from IIdLabel.

Constructors

ItemBaseRepositoryT Constructor that sets up the container this repository is going to be using, and gets access to the memory cache.

Properties

Container The Azure Cosmos Db Container used by this Business Object.
ReplicationLayer The Replication Layer hosted on the Azure Cache for Redis.

Methods

Create Upload a new instance of a model to the cloud
CreateContainer If the container doesn't exist, this method will be invoked to set it up.
Every container has its own setup, so this method is abstract.
Delete(T, UserSessionData, Boolean, CancellationToken) Delete a business object instance permanently from the cloud
Delete(T, Guid, CompanyDto, Boolean, CancellationToken) Delete a business object instance permanently from the cloud
DeleteList(IDictionaryGuid, T, AccountDto, CompanyDto, Boolean, CancellationToken) Deletes a stack of items
DeleteList(IReadOnlyCollectionT, AccountDto, CompanyDto, Boolean, CancellationToken) Deletes a stack of items
GeneratePartitionKey Generates a partition key for this container
GetCustomItemQueryIteratorTc Returns Item Query Iterator (useful for NoSQL queries) for a custom return type.
This is often used for COUNT queries, or if the return object we need is different from the business object the repository is based on.
GetItemQueryIterator Returns Item Query Iterator (useful for NoSQL queries)
PartialUpdate Performs a partial update on an item in the cloud using a list of PatchOperations.
ReplicationLayerCacheKey Generates a cache key for the given item. (for the memory cache ReplicationLayer usage). The way we do caching reflect the partition keys of the containers.
Update Update values of a business object in the cloud

Extension Methods

CountAsyncT Counts the amount of items in a repository. A partitionKey can be added as a filter. If you want to add a query, use the overload of this method containing the parameter to add a QueryDefinition
(Defined by CosmosExtensions)
CountAsyncT Counts the amount of items in a repository's Container filtered by the query and the (optional) partitionKey.
(Defined by CosmosExtensions)
GetItemFromCosmosByIdT Retrieves a single item from the database by its ID.
(Defined by CosmosExtensions)
LoadEntireStackT Reads an entire stack of an Azure Cosmos Container, only filtered by the partitionKey if it isn't left empty.
(Defined by CosmosExtensions)
RetrieveGlobalAutoCompleteT This method is used for the search bar on top of the screen in the Portal; it retrieves 3 items for that datatype where the query contains a part of the Label. (not case-sensitive). The items are also filtered by the user's environment scope if the user doesn't have the permission to view all environments.
(Defined by CosmosExtensions)
RetrieveItemsForAutoCompleteT This method is used for the search bar on top of the screen in the Portal; it retrieves 3 items for that datatype where the query contains a part of the Label. (not case-sensitive). The items are also filtered by the user's environment scope if the user doesn't have the permission to view all environments.
(Defined by CosmosExtensions)

See Also