public void Delete(int id) { BllTask item = repository.GetById(id); item.IsDeleted = true; repository.Update(item); BllAction action = actionRepository.Create(new BllAction { ActionId = (int)BllActionEnum.Delete, TaskId = item.Id }); WorkerManager.AddWork(new DeleteTask(item.Id, repository, action.Id, actionRepository), item.UserId); }
public void Update(BllTask item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } repository.Update(item); BllAction action = actionRepository.Create(new BllAction { ActionId = (int)BllActionEnum.Update, TaskId = item.Id }); WorkerManager.AddWork(new UpdateTask(item.Id, repository, action.Id, actionRepository), item.UserId); }
public BllTask Add(BllTask item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } BllTask result = repository.Create(item); BllAction action = actionRepository.Create(new BllAction { ActionId = (int)BllActionEnum.Add, TaskId = result.Id }); WorkerManager.AddWork(new AddTask(result, repository, action.Id, actionRepository), result.UserId); return(result); }