Esempio n. 1
0
        public async Task Set(IWorkContext context, string key, string value)
        {
            key.Verify(nameof(key)).IsNotEmpty();
            value.Verify(nameof(value)).IsNotEmpty();

            var entity = new ConfigurationEntity(key, value);

            TableOperation operation = TableOperation.InsertOrReplace(entity);
            await _table.ExecuteAsync(operation);
        }
Esempio n. 2
0
        public async Task Delete(IWorkContext context, string key)
        {
            key.Verify(nameof(key)).IsNotEmpty();

            var entity = new ConfigurationEntity(key);

            entity.ETag = "*";

            TableOperation operation = TableOperation.Delete(entity);
            await _table.ExecuteAsync(operation);
        }
Esempio n. 3
0
        public async Task <KeyValuePair <string, string>?> Get(IWorkContext context, string key)
        {
            key.Verify(nameof(key)).IsNotEmpty();

            var entity = new ConfigurationEntity(key);

            TableOperation operation   = TableOperation.Retrieve <ConfigurationEntity>(entity.PartitionKey, entity.RowKey);
            TableResult    tableResult = await _table.ExecuteAsync(operation);

            ConfigurationEntity result = tableResult.Result as ConfigurationEntity;

            if (result == null)
            {
                return(default);