예제 #1
0
        public async Task DeleteNotesAsync(IEnumerable <long> noteIds)
        {
            var notes = new List <Note>();

            foreach (var id in noteIds)
            {
                var note = await GetNoteByIdAsync(id);

                if (note == null)
                {
                    continue;
                }
                notes.Add(note);
            }

            await _repository.BatchDeleteAsync(notes);
        }
예제 #2
0
        public async Task DeleteGroupsAsync(IEnumerable <long> groupIds)
        {
            var groups = new List <Group>();

            foreach (var id in groupIds)
            {
                var group = await GetGroupByIdAsync(id);

                if (group == null)
                {
                    continue;
                }
                groups.Add(group);
            }

            await _repository.BatchDeleteAsync(groups);
        }