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)); }
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())); } }
public virtual async Task <SystemAdminModel> CreateAsync(SystemAdminInput systemAdminInput) { SystemAdminModel systemAdmin = new SystemAdminModel(systemAdminInput); return(await this.TableStorageClient.InsertAsync(this.TableName, systemAdmin)); }