public async Task Send(string processName, TaskElementDto task)
        {
            if (!_isConnected)
            {
                await _connection.StartAsync();

                _isConnected = true;
            }
            await _connection.InvokeAsync("SendTaskProcess", processName, task);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
파일: TaskHub.cs 프로젝트: hmtylmz/ossdemo
 public async Task SendTaskProcess(string processName, TaskElementDto task)
 {
     await Clients.All.SendAsync("TaskProcess", processName, task);
 }
예제 #5
0
        public async Task <IActionResult> UpdateTask([FromBody] TaskElementDto task)
        {
            var res = await _taskService.UpdateAsync(task);

            return(Ok(res));
        }
예제 #6
0
        public async Task <IActionResult> InsertTaskAsync([FromBody] TaskElementDto task)
        {
            var res = await _taskService.AddAsync(task);

            return(Ok(res));
        }