public IActionResult ViewImage(int id)
        {
            var image = userImageService.GetByUserId(id);

            if (image != null)
            {
                var ms = new MemoryStream(image.Data);

                var imageItem = new FileStreamResult(ms, image.ContentType);

                return(Ok(imageItem));
            }

            return(null);
        }
Beispiel #2
0
        public IActionResult GetByUserId(int id)
        {
            var result = _userImageService.GetByUserId(id);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Beispiel #3
0
 public IResult Delete(User user)
 {
     _userDal.Delete(user);
     _userImageService.Delete(_userImageService.GetByUserId(user.Id).Data);
     return(new SuccessResult(Messages.UserDeleted));
 }