protected override async Task Handle(DeletePhotoCommand request, CancellationToken cancellationToken) { var user = await _userRepository.Single( u => u.Id == request.AuthenticatedUser.Id, cancellationToken ); user.DeletePhoto(request.PhotoName); await _photoStorage.Delete(new DeletePhotoRequest(request.PhotoName), cancellationToken); }
public RedirectToActionResult DeletePhoto(int id) { _photoStorage.Delete(id); return(RedirectToAction("PhotoList", "Photo")); }