public IActionResult AddImage(CarImage carImages)
        {
            var result = _carImagesService.Add(carImages);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 2
0
        public IActionResult Add([FromForm] IFormFile image, [FromForm] CarImage img)
        {
            var result = _carImageService.Add(image, img);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult Add([FromForm(Name = ("Image"))] IFormFile file, [FromForm] CarImage carImage)
        {
            var result = _carImageService.Add(file, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 4
0
        public IActionResult Add([FromForm] IFormFile image, [FromForm] CarImage carImage)    //[FromForm] attributu from-data kullanıldığını belirtiyor(postman de)
        {
            var result = _carImageService.Add(image, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 5
0
        public IActionResult Add([FromForm] CarImagesDto carImagesDto)
        {
            var result = _carImageService.Add(carImagesDto);

            if (!result.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Exemplo n.º 6
0
        public IActionResult Add([FromForm] FileToUpload fileToUpload, int carId)
        {
            var result = _carImageService.Add(carId, DateTime.Now, fileToUpload.file);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 7
0
        public IActionResult Add([FromForm] FileTools file, [FromForm] CarImage carImage)
        {
            var result = _carImageService.Add(file, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult UploadImage([FromForm] IFormFile files, int id)
        {
            var result = carImageService.Add(id, files);

            if (result.IsSuccess)
            {
                return(Ok(result));
            }
            return(BadRequest(result.Message));
        }
Exemplo n.º 9
0
        public IActionResult Add([FromForm(Name = ("Image"))] IFormFile file, [FromForm] CarImage carImage)//resımı Image adı ıle vermen gerek yoksa almaz bu name strınglerı vermesendaya ıyı olurdu
        {
            var result = _carImageService.Add(file, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult Add([FromForm(Name = ("CarImage"))] IFormFile file, [FromForm] CarImage carImage)
        {
            //file = Request.Form.Files[0];
            var result = _carImageService.Add(carImage, file);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult Add(IFormFile file, [FromForm] CarImage carImage)
        {
            var result = _carImageService.Add(carImage, file, webRootPath);

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

            return(BadRequest(result));
        }
Exemplo n.º 12
0
        public IActionResult Add([FromForm] CarImage carImage, [FromForm] IFormFile file)
        {
            carImage.Date = DateTime.Now;
            var result = _carImageService.Add(carImage, file);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 13
0
        public IActionResult AddAsync([FromForm(Name = ("Image"))] List <IFormFile> file, [FromForm] CarImage images)
        {
            var result = _carImageService.Add(file, images);

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

            return(BadRequest(result));
        }
Exemplo n.º 14
0
        public async Task <IActionResult> Add([FromForm] CarImage carImage, [FromForm(Name = "Image")] IFormFile file)
        {
            var result = await _carImageService.Add(carImage, file);

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

            return(BadRequest(result));
        }
Exemplo n.º 15
0
        public IActionResult Add(IFormFile file, CarImage carImage)
        {
            var result = _carImageService.Add(file, carImage);

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

            return(BadRequest(result.Message));
        }
Exemplo n.º 16
0
        public IActionResult Add([FromForm] IFormFile objectFile, [FromForm] CarImage carImage)
        {
            string filePath = _webHostEnvironment.WebRootPath + "\\Images\\";
            var    result   = _carImageService.Add(objectFile, filePath, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 17
0
        public IActionResult Add([FromForm(Name = "Image")] IFormFile file, [FromForm] CarImage carImage)
        {
            var result = _carImageService.Add(file, carImage);

            if (result.Succes)
            {
                return(Ok(result));
            }
            Console.WriteLine("Hatalı bişeyler oldu");
            return(BadRequest(result));
        }
Exemplo n.º 18
0
        public IActionResult Add(List <IFormFile> files)
        {
            CarImage carImage = Image();
            var      result   = _carImageService.Add(carImage, files);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult Add([FromForm(Name = ("Image"))] IFormFile file, [FromForm] CarImage carImage)
        {
            carImage.ImagePath = Path.Combine(_hostingEnvironment.WebRootPath, "Uploads", "Images", file.FileName);
            var result = _carImageService.Add(file, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 20
0
        public IActionResult Add([FromForm(Name = ("CarImagesFile"))] IFormFile file, [FromForm] CarImage carImage)
        {
            carImage.ImagePath = "C:\\Users\\lenovo\\Desktop\\images\\" + file.FileName;

            var result = _carImageService.Add(carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 21
0
        public IActionResult Add([FromForm] CarImage carImage, IFormFile file)
        {
            string wwwRootPath = _webHostEnvironment.WebRootPath;

            var result = _carImageService.Add(carImage, file, wwwRootPath, "IMAGE");

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 22
0
        public IActionResult AddAsync([FromForm(Name = ("Image"))] IFormFile file, [FromForm] CarImage carImage)
        {
            carImage.Date      = DateTime.Now;
            carImage.ImagePath = FileHelper.AddAsync(file);
            var result = _carImageService.Add(carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 23
0
        public IActionResult Add([FromForm(Name = "carId")] string carId, [FromForm(Name = "file")] IFormFile file, string path = null)
        {
            var result = _carImageService.Add(new CarImage {
                CarId = Convert.ToInt32(carId), Date = DateTime.Now
            }, file, path);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 24
0
        public IActionResult Add([FromForm(Name = ("Image"))] IFormFile file, [FromForm] CarImage carImage)
        {
            carImage.ImageDate = DateTime.Now;
            var result = _carImageService.Add(file, carImage);

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

            return BadRequest(result);
        }
Exemplo n.º 25
0
        public IActionResult Add([FromForm(Name = ("Image"))] IFormFile objectFile, [FromForm(Name = ("CarId"))] int carId)
        {
            var result = _carImageService.Add(objectFile, new CarImage {
                CarId = carId
            });

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 26
0
        public IActionResult Add([FromForm] FileUpload objectFile)
        {
            var image = new CarImage {
                CarId = objectFile.CarId
            };
            var result = _carImageService.Add(image, objectFile.Files);

            if (result.Success)
            {
                Ok(result);
            }
            return(BadRequest(result));
        }
Exemplo n.º 27
0
        public IActionResult Add(IFormFile file, int carId)
        {
            CarImage carImage = new CarImage {
                CarId = carId
            };
            var result = _carImageService.Add(file, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 28
0
        public IActionResult Add(CarImage carImage)
        {
            var result = _carImageService.Add(carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            else
            {
                return(BadRequest(result));
            }
        }
        // public IActionResult Add([FromForm] CarImage carImage, [FromForm(Name = "Image")] IFormFile file)
        public IActionResult Add([FromForm] CarImage carImage, [FromForm] IFormFile file)
        {
            var result = _carImageService.Add(carImage, file);

            if (result.Success)
            {
                return(Ok(result));
            }
            else
            {
                return(BadRequest(result));
            }
        }
Exemplo n.º 30
0
        public IActionResult Add([FromForm] IFormFile imageFile, [FromForm] CarImage entity)
        {
            entity.Date      = DateTime.Now;
            entity.ImagePath = Guid.NewGuid() + Path.GetExtension(imageFile.FileName);
            var result = _carImageService.Add(entity);

            if (result.Success)
            {
                Operation.WriteImageFile(imageFile, _configuration.GetSection("ImageRootPath").Value, entity.ImagePath);
                return(Ok(result));
            }
            return(BadRequest(result));
        }