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(); } }
public async Task <IActionResult> RemoveNote(int noteId) { try { await _noteService.Delete(noteId, GetUserId()); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
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); }
public void Delete(Guid id) { Log.Instance.Info("Удаление заметки с ID {0}", id); _notesRepository.Delete(id); }