Exemple #1
0
        /// <summary>
        /// Removes the specified note ids from the collection, and logs them in
        /// the graves table.
        /// </summary>
        /// <param name="noteIds">The list of note ids to remove.</param>
        /// <returns>The number of notes removed.</returns>
        public async Task <long> RemoveNotes(List <long> noteIds)
        {
            var notes = context.Notes
                        .Where(n => noteIds.Contains(n.ClientId) && n.UserId == collection.UserId);

            await LogRemovals(noteIds, GraveType.Note);

            context.RemoveRange(notes);

            long notesCount = notes.Count();

            await context.SaveChangesAsync();

            return(notesCount);
        }