Esempio n. 1
0
        /// <summary>
        /// Removes the specified item from the cache.
        /// </summary>
        /// <param name="key">The identifier for the item to delete.</param>
        /// <returns>true if the item was successfully removed from the cache; false otherwise.</returns>
        public bool Remove(string key)
        {
            using (DeleteOperation d = new DeleteOperation(this.pool, key))
            {
                d.Execute();

                return(d.Success);
            }
        }
Esempio n. 2
0
        private async Task <string> Delete()
        {
            var parameter = this.Bind <DeleteModel>();
            var path      = parameter.Path;

            if (string.IsNullOrWhiteSpace(path))
            {
                return("not a specified path");
            }
            DeleteOperation deleteOperation = new DeleteOperation();

            return(await Task.FromResult(deleteOperation.Execute(path)));
        }
Esempio n. 3
0
 private void HandleRemoveRequest(string indexName, IEnumerable <string> ids)
 {
     try
     {
         var dir = Path.Combine(ToolBelt.GetDataDirectory(), indexName);
         using (var delete = new DeleteOperation(dir, ids))
         {
             delete.Execute();
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         throw;
     }
 }
Esempio n. 4
0
        public void Delete <T>(T entity) where T : class
        {
            DeleteOperation <T> operation = new DeleteOperation <T>(this);

            operation.Execute(entity);
        }