예제 #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);
            }
        }
예제 #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)));
        }
예제 #3
0
파일: WriteModule.cs 프로젝트: ruo2012/sir
 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;
     }
 }
예제 #4
0
        public void Delete <T>(T entity) where T : class
        {
            DeleteOperation <T> operation = new DeleteOperation <T>(this);

            operation.Execute(entity);
        }