コード例 #1
0
 private void imgDelete_MouseUp(object sender, MouseButtonEventArgs e)
 {
     if (_note.State == NoteState.New || System.Windows.MessageBox.Show("Are you sure you wish to remove the note: '" + _note.Title + "'?", "OP.Notes", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         _note.Delete();
     }
 }
コード例 #2
0
        public async Task <IActionResult> RemoveNote(int noteId)
        {
            try
            {
                await _noteService.Delete(noteId, GetUserId());

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
コード例 #3
0
            public async Task <bool> Handle(Request request, CancellationToken cancellationToken)
            {
                bool result = false;

                try
                {
                    result = await Task.FromResult(noteModule.Delete(request.Text));
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return(result);
            }
コード例 #4
0
 public void Delete(Guid id)
 {
     Log.Instance.Info("Удаление заметки с  ID {0}", id);
     _notesRepository.Delete(id);
 }