public async Task <Photo> RemoveAsync(int id) { Photo photo = await FindAsync(id); var user = await userService.GetUserAsync(); if (await photosAuthorizationService.ItemMayBeDeletedAsync(user, photo)) { return(await repository.RemoveAsync(id)); } else { throw new UnauthorizedDeleteAttemptException <Photo>($"Unauthorized Deletion Attempt of Photo {photo.Id}"); } }
public async Task <Photo> RemoveAsync(int id, string tokenValue) => await _photosRepository.RemoveAsync(id, tokenValue);
public async Task <Photo> RemoveAsync(int id) { _logger.LogInformation("RemoveAsync called", id); return(await _photosRepository.RemoveAsync(id)); }