private Task <object> Delete(IBlackListEntity entity) => Task.Run(() => { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } var items = this.DataSet.ToList(); items.Remove(entity); this.Items = new ConcurrentQueue <IBlackListEntity>(items); return((object)entity); });
public Task <object> Add(IBlackListEntity entity) => Task.Run <object>(() => { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } if (!string.IsNullOrWhiteSpace(entity.Content)) { this.Items.Enqueue(entity); } return(entity); });
public Task <object> Update(IBlackListEntity entity) => this.Add(entity);