예제 #1
0
        public virtual async Task <SystemAdminListModel> GetAsync(SystemAdminInput input)
        {
            TableQuery <SystemAdminModel> query  = new TableQuery <SystemAdminModel>().Where(TableQuery.GenerateFilterCondition(this.PartitionKey, QueryComparisons.Equal, input.UserId));
            List <SystemAdminModel>       result = await this.TableStorageClient.QueryAsync <SystemAdminModel>(this.TableName, query);

            return(new SystemAdminListModel(this.GetSystemAdminBatchMethod, result));
        }
예제 #2
0
        public virtual async Task <SystemAdminModel> DeleteAsync(SystemAdminInput input)
        {
            SystemAdminListModel model = await this.GetAsync(input);

            if (model == null)
            {
                string           errorMessage = $"Super user  does not exist with {input.UserId}";
                StorageException exception    = new StorageException(errorMessage);
                this.logger.LogError(exception, errorMessage);
                throw exception;
            }
            else
            {
                return(await this.TableStorageClient.DeleteAsync <SystemAdminModel>(this.TableName, model.Models.FirstOrDefault()));
            }
        }
예제 #3
0
        public virtual async Task <SystemAdminModel> CreateAsync(SystemAdminInput systemAdminInput)
        {
            SystemAdminModel systemAdmin = new SystemAdminModel(systemAdminInput);

            return(await this.TableStorageClient.InsertAsync(this.TableName, systemAdmin));
        }