| AzureCosmosDb | Azure Cosmos DB ORM implementation (for singleton usage). This class is only used outside this namespace to set up the dependency injection. For code usage, refer to IAzureCosmosDb. |
| GridResultsT |
This class is used for data lookups when we want to fill a table with data.
It returns the data in Results. In TotalDataCount we return the total number of items in based on the query/partition key provided. In StartIndex we return the index of the first item in the Results list. |
| IAzureCosmosDb |
Azure Cosmos Db ORM (interface of singleton implementation). This interface is used to interact with the Azure Cosmos Database. It allows the programmer to create, modify or delete items derived from IIdLabel. In some cases, such methods are only allowed if the user's RoleDto has the correct permissions. To prevent users from accessing methods they shouldn't, the AccountDto and RoleDto of the user are required in many methods. There the RoleDto's Permissions are checked against the method's requirements. If the user doesn't have the permissions, this will be logged as a potential hacking attempt. As per the guidelines for logging potential hacking attempts, this is why the user's IP Address is also required as a parameter. This means that the IAzureCosmosDb interface is the last line of defense against unauthorized access. Preceding code should already have prevented the user from being offered this feature. In theory, no method should ever fail to execute. However, we're relying on an internet connection with Azure, and Azure in turn has a lot of moving parts. Because of this, Cosmos can sometimes be slow to respond, or even fail to respond because of things outside ours or Microsoft's control. In such cases, we can we returned a CosmosException. The front-end should be able to inform the user of this issue. |