Exemple #1
0
        public async Task <IActionResult> Edit([FromRoute] Guid id, [FromBody] TaskGroupPutDto taskGroupPutDto)
        {
            if (id != taskGroupPutDto.ID)
            {
                return(BadRequest());
            }

            await taskGroupService.UpdateAsync(taskGroupPutDto);

            return(NoContent());
        }
        public async Task <bool> UpdateAsync(TaskGroupPutDto entity)
        {
            var exists = await _repository.GetByIdAsync(entity.ID);

            if (exists == null)
            {
                return(false);
            }
            else
            {
                await _repository.UpdateAsync(mapper.Map <TaskGroup>(entity));

                return(true);
            }
        }