Esempio n. 1
0
        public async Task <IActionResult> GetImageContent(int id)
        {
            var content = await _pictureStorage.GetPicture(id);

            if (content != null)
            {
                return(File(content, "image/jpeg"));
            }

            return(NotFound());
        }
Esempio n. 2
0
        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"));
        }