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);
        }
Exemple #2
0
 public RedirectToActionResult DeletePhoto(int id)
 {
     _photoStorage.Delete(id);
     return(RedirectToAction("PhotoList", "Photo"));
 }