예제 #1
0
        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);
        });
예제 #2
0
        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);
        });
예제 #3
0
 public Task <object> Update(IBlackListEntity entity) => this.Add(entity);