/// <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); } }
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))); }
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; } }
public void Delete <T>(T entity) where T : class { DeleteOperation <T> operation = new DeleteOperation <T>(this); operation.Execute(entity); }