Пример #1
0
        public IActionResult Update([FromForm] UserImage userImage, [FromForm(Name = "UserImage")] IFormFile formFile)
        {
            var result = _userImageService.Update(userImage, formFile);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult Update([FromForm(Name = "Image")] IFormFile file, [FromForm(Name = ("Id"))] int Id)
        {
            var userImages = _userImageService.GetById(Id).Data;
            var result     = _userImageService.Update(file, userImages);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Пример #3
0
        public IActionResult Update([FromForm(Name = ("image"))] IFormFile file, [FromForm] UserImage entity)
        {
            var result = _userImageService.Update(file, entity);

            if (result.Success)
            {
                return(Ok(result));
            }

            return(BadRequest(result));
        }
        public IActionResult Update([FromForm] UserImageDto imageDto)
        {
            UserImage userImage = new UserImage();

            userImage.UserId      = imageDto.UserId;
            userImage.ImagePath   = imageDto.ImagePath;
            userImage.UserImageId = imageDto.UserImageId;

            var result = _userImageService.Update(imageDto.File, userImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }