public async Task Send(string processName, TaskElementDto task) { if (!_isConnected) { await _connection.StartAsync(); _isConnected = true; } await _connection.InvokeAsync("SendTaskProcess", processName, task); }
public async Task <TaskElementDto> UpdateAsync(TaskElementDto entity) { var taskDbElement = await _taskRepository.FindAsync(entity.Id); _mapper.Map(entity, taskDbElement); taskDbElement.LastUpdatedTime = DateTime.UtcNow; var taskElementDto = _mapper.Map <TaskElementDto>(taskDbElement); await _taskTransportRepository.Send(SocketConstants.TaskUpdate, taskElementDto); await _taskRepository.UpdateAsync(taskDbElement); return(taskElementDto); }
public async Task <TaskElementDto> AddAsync(TaskElementDto taskElementDto) { var taskElement = new TaskElement(); _mapper.Map(taskElementDto, taskElement); taskElement.LastUpdatedTime = DateTime.UtcNow; var taskElementDtoResult = _mapper.Map <TaskElementDto>(taskElement); await _taskTransportRepository.Send(SocketConstants.TaskAdd, taskElementDtoResult); await _taskRepository.InsertAsync(taskElement); return(taskElementDtoResult); }
public async Task SendTaskProcess(string processName, TaskElementDto task) { await Clients.All.SendAsync("TaskProcess", processName, task); }
public async Task <IActionResult> UpdateTask([FromBody] TaskElementDto task) { var res = await _taskService.UpdateAsync(task); return(Ok(res)); }
public async Task <IActionResult> InsertTaskAsync([FromBody] TaskElementDto task) { var res = await _taskService.AddAsync(task); return(Ok(res)); }