コード例 #1
0
ファイル: ToDoService.cs プロジェクト: henrybeen/TestingDemo
        public async Task DeleteAsync(Guid id)
        {
            var todo = _toDoRepository.GetById(id);

            _logger.LogTrace("Deleting todo with id {id}", todo.id);

            await _toDoRepository.DeleteAsync(todo);
        }
コード例 #2
0
        public async Task <IActionResult> DeleteToDo(string id)
        {
            if (await myToDoRepository.DeleteAsync(id))
            {
                return(NoContent());
            }

            return(NotFound());
        }
コード例 #3
0
        public async Task DeleteAsync(Guid userId, Guid cardId, Guid toDoId)
        {
            var user = await userRepository.GetAsync(userId);

            var card = user.Cards.FindIfExist(s => s.Id == cardId, ErrorCode.UserCardNotExist);
            var toDo = card.ToDos.FindIfExist(s => s.Id == toDoId, ErrorCode.ToDoNotExist);
            await toDoRepository.DeleteAsync(toDo);

            await toDoRepository.SaveChangesAsync();
        }
コード例 #4
0
ファイル: ToDoService.cs プロジェクト: HrMilev/PM
 public async Task <bool> DeleteAsync(string id, string userId)
 {
     return(await _toDoRepository.DeleteAsync(x => x.UserId == userId && x.Id.ToString() == id));
 }
コード例 #5
0
ファイル: ToDoService.cs プロジェクト: san-had/ToDoApp
 public async Task DeleteToDoItemAsync(int id)
 {
     await toDoRepository.DeleteAsync(id);
 }
コード例 #6
0
ファイル: DeleteService.cs プロジェクト: JohnPicchi/ToDo
 public async Task DeleteAsync(Guid id)
 {
     await toDoRepository.DeleteAsync(id);
 }