public async Task <IActionResult> GetImageContent(int id) { var content = await _pictureStorage.GetPicture(id); if (content != null) { return(File(content, "image/jpeg")); } return(NotFound()); }
public async Task <IActionResult> GetPicture(CancellationToken token = default) { var user = await _currentUserInfo.GetCurrentUser(token); if (user == null) { return(Unauthorized()); } var content = await _pictureStorage.GetPicture(user.Cpf, token); if (content == null) { return(NotFound()); } return(File(content, "image/jpeg")); }